org.eclipse.xtext.nodemodel
Interface ICompositeNode

All Superinterfaces:
INode
All Known Implementing Classes:
CompositeNode, CompositeNodeWithSemanticElement, CompositeNodeWithSemanticElementAndSyntaxError, CompositeNodeWithSyntaxError, RootNode, SyntheticCompositeNode

public interface ICompositeNode
extends INode

A composite node in the parse tree. A composite node may or may not contain child nodes.

Author:
Sebastian Zarnekow - Initial contribution and API

Method Summary
 BidiIterable<INode> getChildren()
          Returns an iterable that provides access to the children of the composite node.
 INode getFirstChild()
          Returns the first child of this node.
 INode getLastChild()
          Returns the last child of this node.
 int getLookAhead()
          Return the number of tokens that the parser had to peek before it could decide to create this node.
 boolean hasChildren()
          Returns true if this node has any children.
 
Methods inherited from interface org.eclipse.xtext.nodemodel.INode
getAsTreeIterable, getEndLine, getGrammarElement, getLeafNodes, getLength, getNextSibling, getOffset, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTotalEndLine, getTotalEndOffset, getTotalLength, getTotalOffset, getTotalStartLine, hasDirectSemanticElement, hasNextSibling, hasPreviousSibling, hasSiblings
 

Method Detail

getChildren

BidiIterable<INode> getChildren()
Returns an iterable that provides access to the children of the composite node. Will never return null but may be empty.

Returns:
an iterable that provides access to the children of the composite node.
See Also:
hasChildren(), getFirstChild(), getLastChild()

hasChildren

boolean hasChildren()
Returns true if this node has any children.

Returns:
true if this node has any children.
See Also:
getChildren(), getFirstChild(), getLastChild()

getFirstChild

INode getFirstChild()
Returns the first child of this node. May be null or may be the same as the last child.

Returns:
the first child of this node if any.
See Also:
hasChildren(), getChildren()

getLastChild

INode getLastChild()
Returns the last child of this node. May be null or may be the same as the first child.

Returns:
the last child of this node if any.
See Also:
hasChildren(), getChildren()

getLookAhead

int getLookAhead()
Return the number of tokens that the parser had to peek before it could decide to create this node. Never negative. Clients will usually not have to deal with getLookAhead().

Returns:
the number of tokens that the parser had to peek before it could decide to create this node.