|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.runtime.tree.BaseTree
org.antlr.runtime.tree.CommonTree
public class CommonTree
A tree node that is wrapper for a Token object.
Field Summary | |
---|---|
int |
startIndex
What token indexes bracket all tokens associated with this node and below? |
int |
stopIndex
What token indexes bracket all tokens associated with this node and below? |
Token |
token
A single token is the payload |
Fields inherited from class org.antlr.runtime.tree.BaseTree |
---|
children |
Fields inherited from interface org.antlr.runtime.tree.Tree |
---|
INVALID_NODE |
Constructor Summary | |
---|---|
CommonTree()
|
|
CommonTree(CommonTree node)
|
|
CommonTree(Token t)
|
Method Summary | |
---|---|
Tree |
dupNode()
|
int |
getCharPositionInLine()
|
int |
getLine()
In case we don't have a token payload, what is the line for errors? |
java.lang.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 |
setTokenStartIndex(int index)
|
void |
setTokenStopIndex(int index)
|
java.lang.String |
toString()
Override to say how a node (not a tree) should look as text |
Methods inherited from class org.antlr.runtime.tree.BaseTree |
---|
addChild, addChildren, createChildrenList, deleteChild, dupTree, getChild, getChildCount, getFirstChildWithType, setChild, toStringTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int startIndex
public int stopIndex
public Token token
Constructor Detail |
---|
public CommonTree()
public CommonTree(CommonTree node)
public CommonTree(Token t)
Method Detail |
---|
public Token getToken()
public Tree dupNode()
public boolean isNil()
Tree
isNil
in interface Tree
isNil
in class BaseTree
public int getType()
Tree
public java.lang.String getText()
public int getLine()
Tree
getLine
in interface Tree
getLine
in class BaseTree
public int getCharPositionInLine()
getCharPositionInLine
in interface Tree
getCharPositionInLine
in class BaseTree
public int getTokenStartIndex()
Tree
public void setTokenStartIndex(int index)
public int getTokenStopIndex()
Tree
public void setTokenStopIndex(int index)
public java.lang.String toString()
BaseTree
toString
in interface Tree
toString
in class BaseTree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |