use of org.eclipse.xtext.generator.trace.node.IGeneratorNode in project xtext-core by eclipse.
the class CompositeGeneratorNode method toString.
@Override
public String toString() {
StringConcatenation _builder = new StringConcatenation();
String _simpleName = this.getClass().getSimpleName();
_builder.append(_simpleName);
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
for (final IGeneratorNode c : this.children) {
_builder.append("\t");
String _string = c.toString();
_builder.append(_string, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("}");
_builder.newLine();
return _builder.toString();
}
use of org.eclipse.xtext.generator.trace.node.IGeneratorNode in project xtext-core by eclipse.
the class GeneratorNodeExtensions method appendTemplate.
/**
* Creates a template node for the given templateString and appends it to the given parent node.
*
* Templates are translated to generator node trees and expressions in templates can be of type IGeneratorNode.
*
* @return the given parent node
*/
public CompositeGeneratorNode appendTemplate(final CompositeGeneratorNode parent, final StringConcatenationClient templateString) {
final TemplateNode proc = new TemplateNode(templateString, this);
List<IGeneratorNode> _children = parent.getChildren();
_children.add(proc);
return parent;
}
use of org.eclipse.xtext.generator.trace.node.IGeneratorNode in project xtext-core by eclipse.
the class GeneratorNodeExtensions method trace.
/**
* @return a trace node for the given location, appended as a child on the given parent
*/
public CompositeGeneratorNode trace(final CompositeGeneratorNode parent, final ILocationData data, final boolean useForDebugging) {
final TraceNode result = new TraceNode(data);
result.setUseForDebugging(useForDebugging);
List<IGeneratorNode> _children = parent.getChildren();
_children.add(result);
return result;
}
use of org.eclipse.xtext.generator.trace.node.IGeneratorNode in project xtext-core by eclipse.
the class GeneratorNodeExtensions method trace.
/**
* @return a trace node for the given location, appended as a child on the given parent
*/
public CompositeGeneratorNode trace(final CompositeGeneratorNode parent, final ILocationData data) {
final TraceNode result = new TraceNode(data);
List<IGeneratorNode> _children = parent.getChildren();
_children.add(result);
return result;
}
use of org.eclipse.xtext.generator.trace.node.IGeneratorNode in project xtext-core by eclipse.
the class GeneratorNodeExtensions method indent.
/**
* Appends the indentation string at the current position of the parent and adds a new composite node, indicating the same indentation for
* subsequent lines.
*
* @return an indentation node, using the given indentString, appended as a child on the given parent
*/
public CompositeGeneratorNode indent(final CompositeGeneratorNode parent, final String indentString) {
final IndentNode indent = new IndentNode(indentString);
List<IGeneratorNode> _children = parent.getChildren();
_children.add(indent);
return indent;
}
Aggregations