Search in sources :

Example 1 with NewLineNode

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

the class GeneratorNodeExtensions method appendNewLine.

/**
 * Appends a line separator node to the given parent.
 *
 * @return the given parent node
 */
public CompositeGeneratorNode appendNewLine(final CompositeGeneratorNode parent) {
    List<IGeneratorNode> _children = parent.getChildren();
    String _lineDelimiter = this.wsConfig.getLineDelimiter();
    NewLineNode _newLineNode = new NewLineNode(_lineDelimiter, false);
    _children.add(_newLineNode);
    return parent;
}
Also used : IGeneratorNode(org.eclipse.xtext.generator.trace.node.IGeneratorNode) NewLineNode(org.eclipse.xtext.generator.trace.node.NewLineNode)

Example 2 with NewLineNode

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

the class GeneratorNodeExtensions method appendNewLineIfNotEmpty.

/**
 * Appends a line separator node that will only be effective if the current line contains non-whitespace text.
 *
 * @return the given parent node
 */
public CompositeGeneratorNode appendNewLineIfNotEmpty(final CompositeGeneratorNode parent) {
    List<IGeneratorNode> _children = parent.getChildren();
    String _lineDelimiter = this.wsConfig.getLineDelimiter();
    NewLineNode _newLineNode = new NewLineNode(_lineDelimiter, true);
    _children.add(_newLineNode);
    return parent;
}
Also used : IGeneratorNode(org.eclipse.xtext.generator.trace.node.IGeneratorNode) NewLineNode(org.eclipse.xtext.generator.trace.node.NewLineNode)

Example 3 with NewLineNode

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

the class GeneratorNodeExtensions method appendNewLine.

/**
 * Appends a line separator node to the given parent.
 *
 * @return the given parent node
 */
public CompositeGeneratorNode appendNewLine(final CompositeGeneratorNode parent, final String lineSeparator) {
    List<IGeneratorNode> _children = parent.getChildren();
    NewLineNode _newLineNode = new NewLineNode(lineSeparator, false);
    _children.add(_newLineNode);
    return parent;
}
Also used : IGeneratorNode(org.eclipse.xtext.generator.trace.node.IGeneratorNode) NewLineNode(org.eclipse.xtext.generator.trace.node.NewLineNode)

Aggregations

IGeneratorNode (org.eclipse.xtext.generator.trace.node.IGeneratorNode)3 NewLineNode (org.eclipse.xtext.generator.trace.node.NewLineNode)3