use of org.eclipse.xtext.generator.trace.node.TextNode in project xtext-core by eclipse.
the class GeneratorNodeExtensions method append.
/**
* Creates a text node containing the toString() representation of the given object and
* appends it to the given parent node.
*
* @return the given parent node
*/
public CompositeGeneratorNode append(final CompositeGeneratorNode parent, final Object object) {
if ((object instanceof StringConcatenationClient)) {
this.appendTemplate(parent, ((StringConcatenationClient) object));
} else {
if ((object instanceof IGeneratorNode)) {
List<IGeneratorNode> _children = parent.getChildren();
_children.add(((IGeneratorNode) object));
} else {
if ((object != null)) {
List<IGeneratorNode> _children_1 = parent.getChildren();
String _string = object.toString();
TextNode _textNode = new TextNode(_string);
_children_1.add(_textNode);
}
}
}
return parent;
}
Aggregations