public class RootNode extends CompositeNodeWithSemanticElementAndSyntaxError
Constructor and Description |
---|
RootNode() |
Modifier and Type | Method and Description |
---|---|
protected int[] |
basicGetLineBreakOffsets()
Returns an array that contains the offsets of each line break in the input.
|
protected AbstractNode |
basicGetNextSibling() |
protected AbstractNode |
basicGetPreviousSibling() |
protected boolean |
basicHasNextSibling() |
protected boolean |
basicHasPreviousSibling() |
protected void |
basicSetCompleteContent(java.lang.String completeContent) |
protected void |
basicSetNextSibling(AbstractNode next) |
protected void |
basicSetParent(CompositeNode parent) |
protected void |
basicSetPreviousSibling(AbstractNode prev) |
protected int[] |
computeLineBreaks(java.lang.String text)
Computes the line breaks in the given text and returns an array of offsets.
|
void |
fillGrammarElementToIdMap(java.util.Map<org.eclipse.emf.ecore.EObject,java.lang.Integer> grammarElementToIdMap,
java.util.List<java.lang.String> grammarIdToURIMap) |
java.lang.String |
getCompleteContent() |
int |
getIndex() |
INode |
getNextSibling()
Returns the next sibling or
null . |
CompositeNode |
getParent()
Returns the parent of the node or
null if and only if this is the root node. |
INode |
getPreviousSibling()
Returns the previous sibling or
null . |
ICompositeNode |
getRootNode()
Returns the root node of this parse tree.
|
java.lang.String |
getText()
Returns the parsed text that is covered by this node (including hidden tokens).
|
int |
getTotalLength()
Returns the length of this node including hidden tokens.
|
int |
getTotalOffset()
Returns the offset of this node including hidden tokens.
|
boolean |
hasNextSibling()
Returns
true if this node is not the last child of its parent. |
boolean |
hasPreviousSibling()
Returns
true if this node is not the first child of its parent. |
boolean |
hasSiblings()
Returns
true if this node has any siblings. |
basicSetSyntaxErrorMessage, getSyntaxErrorMessage
basicGetSemanticElement, basicSetSemanticElement, getSemanticElement, getTarget, isAdapterForType, notifyChanged, setTarget
basicGetChildren, basicGetFirstChild, basicGetLastChild, basicSetFirstChild, basicSetLookAhead, getChildren, getFirstChild, getGrammarElement, getLastChild, getLookAhead, hasChildren, isFolded, isFolded, resolveAsParent
basicGetGrammarElement, basicGetLineOfOffset, basicGetParent, basicHasSiblings, basicIterator, basicSetGrammarElement, getAsTreeIterable, getEndLine, getEndOffset, getLeafNodes, getLength, getOffset, getStartLine, getTextRegion, getTextRegionWithLineInformation, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement, iterator, reverse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsTreeIterable, getEndLine, getEndOffset, getLeafNodes, getLength, getOffset, getStartLine, getTextRegion, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement
public CompositeNode getParent()
INode
null
if and only if this is the root node.getParent
in interface INode
getParent
in class AbstractNode
null
the root node does not have any parent.public ICompositeNode getRootNode()
INode
null
in a consistent tree.getRootNode
in interface INode
getRootNode
in class AbstractNode
null
in a consistent tree.public int getTotalOffset()
INode
getTotalOffset
in interface INode
getTotalOffset
in class CompositeNode
public int getTotalLength()
INode
getTotalLength
in interface INode
getTotalLength
in class CompositeNode
public java.lang.String getText()
INode
null
but may be empty.getText
in interface INode
getText
in class AbstractNode
null
.public int getIndex()
protected void basicSetCompleteContent(java.lang.String completeContent)
protected int[] basicGetLineBreakOffsets()
null
if the completeContent
has not been set.public java.lang.String getCompleteContent()
public INode getNextSibling()
INode
getNextSibling
in interface INode
getNextSibling
in class AbstractNode
null
.INode.hasNextSibling()
,
INode.hasSiblings()
public INode getPreviousSibling()
INode
null
. The result has the same parent
as this node if it is not null
.getPreviousSibling
in interface INode
getPreviousSibling
in class AbstractNode
null
.INode.hasPreviousSibling()
,
INode.hasSiblings()
protected AbstractNode basicGetNextSibling()
basicGetNextSibling
in class AbstractNode
protected AbstractNode basicGetPreviousSibling()
basicGetPreviousSibling
in class AbstractNode
protected boolean basicHasPreviousSibling()
basicHasPreviousSibling
in class AbstractNode
protected boolean basicHasNextSibling()
basicHasNextSibling
in class AbstractNode
public boolean hasPreviousSibling()
INode
true
if this node is not the first child of its parent.hasPreviousSibling
in interface INode
hasPreviousSibling
in class AbstractNode
true
if this node has a previous sibling thus INode.getPreviousSibling()
will
not return null
.public boolean hasNextSibling()
INode
true
if this node is not the last child of its parent.hasNextSibling
in interface INode
hasNextSibling
in class AbstractNode
true
if this node has a next sibling thus INode.getNextSibling()
will
not return null
.public boolean hasSiblings()
INode
true
if this node has any siblings.hasSiblings
in interface INode
hasSiblings
in class AbstractNode
true
if this node has any siblings.INode.hasPreviousSibling()
,
INode.hasNextSibling()
protected void basicSetNextSibling(AbstractNode next)
basicSetNextSibling
in class AbstractNode
protected void basicSetPreviousSibling(AbstractNode prev)
basicSetPreviousSibling
in class AbstractNode
protected void basicSetParent(CompositeNode parent)
basicSetParent
in class AbstractNode
protected int[] computeLineBreaks(java.lang.String text)
Computes the line breaks in the given text and returns an array of offsets.
A line break is either \r\n
, \n
, or a single \r
.
org.eclipse.jface.text.DefaultLineTracker
.text
- the text whose line-breaks should be computed. May not be null
.null
.public void fillGrammarElementToIdMap(java.util.Map<org.eclipse.emf.ecore.EObject,java.lang.Integer> grammarElementToIdMap, java.util.List<java.lang.String> grammarIdToURIMap)