Package org.eclipse.xtext.nodemodel.impl
Class CompositeNode
- java.lang.Object
-
- org.eclipse.xtext.nodemodel.impl.AbstractNode
-
- org.eclipse.xtext.nodemodel.impl.CompositeNode
-
- All Implemented Interfaces:
java.lang.Iterable<INode>
,BidiIterable<INode>
,BidiTreeIterable<INode>
,ICompositeNode
,INode
- Direct Known Subclasses:
CompositeNodeWithSemanticElement
,CompositeNodeWithSyntaxError
public class CompositeNode extends AbstractNode implements ICompositeNode
- Noextend:
- This class is not intended to be subclassed by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.nodemodel.impl.AbstractNode
AbstractNode.NodeType
-
-
Constructor Summary
Constructors Constructor Description CompositeNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BidiIterable<AbstractNode>
basicGetChildren()
protected AbstractNode
basicGetFirstChild()
protected AbstractNode
basicGetLastChild()
protected void
basicSetFirstChild(AbstractNode firstChild)
protected void
basicSetLookAhead(int lookAhead)
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.org.eclipse.emf.ecore.EObject
getGrammarElement()
Returns the grammar element that created 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.protected AbstractNode.NodeType
getNodeId()
int
getTotalLength()
Returns the length of this node including hidden tokens.int
getTotalOffset()
Returns the offset of this node including hidden tokens.boolean
hasChildren()
Returnstrue
if this node has any children.protected boolean
isFolded()
protected boolean
isFolded(java.lang.Object grammarElementOrArray)
protected void
readData(java.io.DataInputStream in, DeserializationConversionContext context)
ICompositeNode
resolveAsParent()
protected void
write(java.io.DataOutputStream out, SerializationConversionContext scc)
-
Methods inherited from class org.eclipse.xtext.nodemodel.impl.AbstractNode
basicGetGrammarElement, basicGetLineOfOffset, basicGetNextSibling, basicGetParent, basicGetPreviousSibling, basicGetSemanticElement, basicHasNextSibling, basicHasPreviousSibling, basicHasSiblings, basicIterator, basicSetGrammarElement, basicSetNextSibling, basicSetParent, basicSetPreviousSibling, getAsTreeIterable, getEndLine, getEndOffset, getLeafNodes, getLength, getNextSibling, getOffset, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTextRegion, getTextRegionWithLineInformation, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement, hasNextSibling, hasPreviousSibling, hasSiblings, iterator, reverse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.nodemodel.INode
getAsTreeIterable, getEndLine, getEndOffset, getLeafNodes, getLength, getNextSibling, getOffset, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTextRegion, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement, hasNextSibling, hasPreviousSibling, hasSiblings
-
-
-
-
Method Detail
-
getChildren
public BidiIterable<INode> getChildren()
Description copied from interface:ICompositeNode
Returns an iterable that provides access to the children of the composite node. Will never returnnull
but may be empty.- Specified by:
getChildren
in interfaceICompositeNode
- Returns:
- an iterable that provides access to the children of the composite node.
- See Also:
ICompositeNode.hasChildren()
,ICompositeNode.getFirstChild()
,ICompositeNode.getLastChild()
-
basicGetChildren
public BidiIterable<AbstractNode> basicGetChildren()
-
hasChildren
public boolean hasChildren()
Description copied from interface:ICompositeNode
Returnstrue
if this node has any children.- Specified by:
hasChildren
in interfaceICompositeNode
- Returns:
true
if this node has any children.- See Also:
ICompositeNode.getChildren()
,ICompositeNode.getFirstChild()
,ICompositeNode.getLastChild()
-
getLookAhead
public int getLookAhead()
Description copied from interface:ICompositeNode
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 withICompositeNode.getLookAhead()
.- Specified by:
getLookAhead
in interfaceICompositeNode
- Returns:
- the number of tokens that the parser had to peek before it could decide to create this node.
-
getTotalLength
public int getTotalLength()
Description copied from interface:INode
Returns the length of this node including hidden tokens.- Specified by:
getTotalLength
in interfaceINode
- Returns:
- the length of this node including hidden tokens.
-
getTotalOffset
public int getTotalOffset()
Description copied from interface:INode
Returns the offset of this node including hidden tokens.- Specified by:
getTotalOffset
in interfaceINode
- Returns:
- the offset of this node including hidden tokens.
-
basicSetLookAhead
protected void basicSetLookAhead(int lookAhead)
-
getFirstChild
public INode getFirstChild()
Description copied from interface:ICompositeNode
Returns the first child of this node. May benull
or may be the same as thelast child
.- Specified by:
getFirstChild
in interfaceICompositeNode
- Returns:
- the first child of this node if any.
- See Also:
ICompositeNode.hasChildren()
,ICompositeNode.getChildren()
-
basicGetFirstChild
protected AbstractNode basicGetFirstChild()
-
basicSetFirstChild
protected void basicSetFirstChild(AbstractNode firstChild)
-
getLastChild
public INode getLastChild()
Description copied from interface:ICompositeNode
Returns the last child of this node. May benull
or may be the same as thefirst child
.- Specified by:
getLastChild
in interfaceICompositeNode
- Returns:
- the last child of this node if any.
- See Also:
ICompositeNode.hasChildren()
,ICompositeNode.getChildren()
-
basicGetLastChild
protected AbstractNode basicGetLastChild()
-
isFolded
protected boolean isFolded()
-
isFolded
protected boolean isFolded(java.lang.Object grammarElementOrArray)
-
resolveAsParent
public ICompositeNode resolveAsParent()
-
getGrammarElement
public org.eclipse.emf.ecore.EObject getGrammarElement()
Description copied from interface:INode
Returns the grammar element that created this node. May returnnull
in case of unrecoverable syntax errors. This happens usually when a keyword occurred at an unexpected offset.- Specified by:
getGrammarElement
in interfaceINode
- Overrides:
getGrammarElement
in classAbstractNode
- Returns:
- the grammar element that created this node. May return
null
.
-
readData
protected void readData(java.io.DataInputStream in, DeserializationConversionContext context) throws java.io.IOException
- Overrides:
readData
in classAbstractNode
- Throws:
java.io.IOException
-
write
protected void write(java.io.DataOutputStream out, SerializationConversionContext scc) throws java.io.IOException
- Overrides:
write
in classAbstractNode
- Throws:
java.io.IOException
-
getNodeId
protected AbstractNode.NodeType getNodeId()
- Specified by:
getNodeId
in classAbstractNode
-
-