Search in sources :

Example 21 with AbstractTraceRegion

use of org.eclipse.xtext.generator.trace.AbstractTraceRegion in project xtext-core by eclipse.

the class GeneratorNodeProcessor method _doProcess.

protected void _doProcess(final TraceNode node, final GeneratorNodeProcessor.Context ctx) {
    boolean __hasContent = this._hasContent(node, ctx);
    if (__hasContent) {
        final AbstractTraceRegion beforeRegion = ctx.currentRegion;
        boolean _isUseForDebugging = node.isUseForDebugging();
        ILocationData _sourceLocation = node.getSourceLocation();
        final GeneratorNodeProcessor.CompletableTraceRegion newRegion = new GeneratorNodeProcessor.CompletableTraceRegion(_isUseForDebugging, _sourceLocation, beforeRegion);
        final int offset = ctx.contentLength();
        final int startLineNumber = ctx.currentLineNumber();
        try {
            ctx.currentRegion = newRegion;
            this.doProcessChildren(node, ctx);
        } finally {
            if ((beforeRegion != null)) {
                ctx.currentRegion = beforeRegion;
            }
            int _contentLength = ctx.contentLength();
            int _minus = (_contentLength - offset);
            newRegion.complete(offset, _minus, startLineNumber, ctx.currentLineNumber());
        }
    }
}
Also used : AbstractTraceRegion(org.eclipse.xtext.generator.trace.AbstractTraceRegion) ILocationData(org.eclipse.xtext.generator.trace.ILocationData)

Aggregations

AbstractTraceRegion (org.eclipse.xtext.generator.trace.AbstractTraceRegion)21 ITraceRegionProvider (org.eclipse.xtext.generator.trace.ITraceRegionProvider)10 ILocationData (org.eclipse.xtext.generator.trace.ILocationData)5 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)4 SourceRelativeURI (org.eclipse.xtext.generator.trace.SourceRelativeURI)4 TraceNotFoundException (org.eclipse.xtext.generator.trace.TraceNotFoundException)4 EList (org.eclipse.emf.common.util.EList)3 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)3 InMemoryFileSystemAccess (org.eclipse.xtext.generator.InMemoryFileSystemAccess)3 IGeneratorNode (org.eclipse.xtext.generator.trace.node.IGeneratorNode)3 Model (org.eclipse.xtext.linking.lazy.lazyLinking.Model)3 Type (org.eclipse.xtext.linking.lazy.lazyLinking.Type)3 ITextRegionWithLineInformation (org.eclipse.xtext.util.ITextRegionWithLineInformation)3 Test (org.junit.Test)3 AbstractIterator (com.google.common.collect.AbstractIterator)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 File (java.io.File)2 InputStream (java.io.InputStream)2 List (java.util.List)2