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 AbstractNodebasicGetFirstChild()protected AbstractNodebasicGetLastChild()protected voidbasicSetFirstChild(AbstractNode firstChild)protected voidbasicSetLookAhead(int lookAhead)BidiIterable<INode>getChildren()Returns an iterable that provides access to the children of the composite node.INodegetFirstChild()Returns the first child of this node.org.eclipse.emf.ecore.EObjectgetGrammarElement()Returns the grammar element that created this node.INodegetLastChild()Returns the last child of this node.intgetLookAhead()Return the number of tokens that the parser had to peek before it could decide to create this node.protected AbstractNode.NodeTypegetNodeId()intgetTotalLength()Returns the length of this node including hidden tokens.intgetTotalOffset()Returns the offset of this node including hidden tokens.booleanhasChildren()Returnstrueif this node has any children.protected booleanisFolded()protected booleanisFolded(java.lang.Object grammarElementOrArray)protected voidreadData(java.io.DataInputStream in, DeserializationConversionContext context)ICompositeNoderesolveAsParent()protected voidwrite(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:ICompositeNodeReturns an iterable that provides access to the children of the composite node. Will never returnnullbut may be empty.- Specified by:
getChildrenin 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:ICompositeNodeReturnstrueif this node has any children.- Specified by:
hasChildrenin interfaceICompositeNode- Returns:
trueif this node has any children.- See Also:
ICompositeNode.getChildren(),ICompositeNode.getFirstChild(),ICompositeNode.getLastChild()
-
getLookAhead
public int getLookAhead()
Description copied from interface:ICompositeNodeReturn 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:
getLookAheadin 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:INodeReturns the length of this node including hidden tokens.- Specified by:
getTotalLengthin interfaceINode- Returns:
- the length of this node including hidden tokens.
-
getTotalOffset
public int getTotalOffset()
Description copied from interface:INodeReturns the offset of this node including hidden tokens.- Specified by:
getTotalOffsetin interfaceINode- Returns:
- the offset of this node including hidden tokens.
-
basicSetLookAhead
protected void basicSetLookAhead(int lookAhead)
-
getFirstChild
public INode getFirstChild()
Description copied from interface:ICompositeNodeReturns the first child of this node. May benullor may be the same as thelast child.- Specified by:
getFirstChildin 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:ICompositeNodeReturns the last child of this node. May benullor may be the same as thefirst child.- Specified by:
getLastChildin 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:INodeReturns the grammar element that created this node. May returnnullin case of unrecoverable syntax errors. This happens usually when a keyword occurred at an unexpected offset.- Specified by:
getGrammarElementin interfaceINode- Overrides:
getGrammarElementin 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:
readDatain classAbstractNode- Throws:
java.io.IOException
-
write
protected void write(java.io.DataOutputStream out, SerializationConversionContext scc) throws java.io.IOException- Overrides:
writein classAbstractNode- Throws:
java.io.IOException
-
getNodeId
protected AbstractNode.NodeType getNodeId()
- Specified by:
getNodeIdin classAbstractNode
-
-