Search in sources :

Example 11 with CompositeGeneratorNode

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

the class TracingSugarTest method _generatePropertyWithDebugging.

@Traced(useForDebugging = true)
public IGeneratorNode _generatePropertyWithDebugging(final Property it) {
    ILocationData _location = this._myExtensions.location(it);
    CompositeGeneratorNode _traceNode = this._myExtensions.trace(_location, true);
    this._myExtensions.appendTemplate(_traceNode, __generatePropertyWithDebugging(it));
    return _traceNode;
}
Also used : CompositeGeneratorNode(org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode) ILocationData(org.eclipse.xtext.generator.trace.ILocationData) Traced(org.eclipse.xtext.generator.trace.node.Traced)

Example 12 with CompositeGeneratorNode

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

the class TracingSugarTest method _generateTypeWithDebugging02.

@Traced
public IGeneratorNode _generateTypeWithDebugging02(final Type it) {
    ILocationData _location = this._myExtensions.location(it);
    CompositeGeneratorNode _traceNode = this._myExtensions.trace(_location, false);
    this._myExtensions.appendTemplate(_traceNode, __generateTypeWithDebugging02(it));
    return _traceNode;
}
Also used : CompositeGeneratorNode(org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode) ILocationData(org.eclipse.xtext.generator.trace.ILocationData) Traced(org.eclipse.xtext.generator.trace.node.Traced)

Example 13 with CompositeGeneratorNode

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

the class TemplateNode method append.

@Override
public void append(final Object object, final String indentation) {
    int _length = indentation.length();
    boolean _greaterThan = (_length > 0);
    if (_greaterThan) {
        final CompositeGeneratorNode before = this.currentParent;
        try {
            IndentNode _indentNode = new IndentNode(indentation, false, true);
            this.currentParent = _indentNode;
            List<IGeneratorNode> _children = before.getChildren();
            _children.add(this.currentParent);
            this.append(object);
        } finally {
            this.currentParent = before;
        }
    } else {
        this.append(object);
    }
}
Also used : IGeneratorNode(org.eclipse.xtext.generator.trace.node.IGeneratorNode) CompositeGeneratorNode(org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode) IndentNode(org.eclipse.xtext.generator.trace.node.IndentNode)

Aggregations

CompositeGeneratorNode (org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode)13 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)6 GeneratorNodeProcessor (org.eclipse.xtext.generator.trace.node.GeneratorNodeProcessor)6 ILocationData (org.eclipse.xtext.generator.trace.ILocationData)5 Traced (org.eclipse.xtext.generator.trace.node.Traced)5 Test (org.junit.Test)5 LocationData (org.eclipse.xtext.generator.trace.LocationData)3 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)2 IndentNode (org.eclipse.xtext.generator.trace.node.IndentNode)2 GeneratorNodeExtensions (org.eclipse.xtext.generator.trace.node.GeneratorNodeExtensions)1 IGeneratorNode (org.eclipse.xtext.generator.trace.node.IGeneratorNode)1