public class CommonTree extends BaseTree
| Modifier and Type | Field and Description |
|---|---|
int |
childIndex
What index is this node in the child list? Range: 0..n-1
|
CommonTree |
parent
Who is the parent node of this node; if null, implies node is root
|
protected int |
startIndex
What token indexes bracket all tokens associated with this node
and below?
|
protected int |
stopIndex
What token indexes bracket all tokens associated with this node
and below?
|
Token |
token
A single token is the payload
|
INVALID_NODE| Constructor and Description |
|---|
CommonTree() |
CommonTree(CommonTree node) |
CommonTree(Token t) |
| Modifier and Type | Method and Description |
|---|---|
Tree |
dupNode() |
int |
getCharPositionInLine() |
int |
getChildIndex()
BaseTree doesn't track child indexes.
|
int |
getLine()
In case we don't have a token payload, what is the line for errors?
|
Tree |
getParent()
BaseTree doesn't track parent pointers.
|
String |
getText() |
Token |
getToken() |
int |
getTokenStartIndex()
What is the smallest token index (indexing from 0) for this node
and its children?
|
int |
getTokenStopIndex()
What is the largest token index (indexing from 0) for this node
and its children?
|
int |
getType()
Return a token type; needed for tree parsing
|
boolean |
isNil()
Indicates the node is a nil node but may still have children, meaning
the tree is a flat list.
|
void |
setChildIndex(int index) |
void |
setParent(Tree t) |
void |
setTokenStartIndex(int index) |
void |
setTokenStopIndex(int index) |
void |
setUnknownTokenBoundaries()
For every node in this subtree, make sure it's start/stop token's
are set.
|
String |
toString()
Override to say how a node (not a tree) should look as text
|
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, freshenParentAndChildIndexesDeeply, freshenParentAndChildIndexesDeeply, getAncestor, getAncestors, getChild, getChildCount, getChildren, getFirstChildWithType, hasAncestor, insertChild, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, toStringTreepublic Token token
protected int startIndex
protected int stopIndex
public CommonTree parent
public int childIndex
public CommonTree()
public CommonTree(CommonTree node)
public CommonTree(Token t)
public Token getToken()
public Tree dupNode()
public boolean isNil()
Treepublic int getType()
Treepublic String getText()
public int getLine()
Treepublic int getCharPositionInLine()
getCharPositionInLine in interface TreegetCharPositionInLine in class BaseTreepublic int getTokenStartIndex()
Treepublic void setTokenStartIndex(int index)
public int getTokenStopIndex()
Treepublic void setTokenStopIndex(int index)
public void setUnknownTokenBoundaries()
public int getChildIndex()
BaseTreegetChildIndex in interface TreegetChildIndex in class BaseTreepublic Tree getParent()
BaseTreepublic void setParent(Tree t)
public void setChildIndex(int index)
setChildIndex in interface TreesetChildIndex in class BaseTreeCopyright © 1992-2013 ANTLR. All Rights Reserved.