Package 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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()
Returnstrue
if this node has any children.-
Methods inherited from interface org.eclipse.xtext.nodemodel.INode
getAsTreeIterable, getEndLine, getEndOffset, getGrammarElement, getLeafNodes, getLength, getNextSibling, getOffset, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTextRegion, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalLength, getTotalOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, 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 returnnull
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()
Returnstrue
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 benull
or may be the same as thelast 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 benull
or may be the same as thefirst 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 withgetLookAhead()
.- Returns:
- the number of tokens that the parser had to peek before it could decide to create this node.
-
-