org.antlr.runtime.tree
Class CommonTree

java.lang.Object
  extended by org.antlr.runtime.tree.BaseTree
      extended by org.antlr.runtime.tree.CommonTree
All Implemented Interfaces:
Tree

public class CommonTree
extends BaseTree

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

startIndex

public int startIndex
What token indexes bracket all tokens associated with this node and below?


stopIndex

public int stopIndex
What token indexes bracket all tokens associated with this node and below?


token

public Token token
A single token is the payload

Constructor Detail

CommonTree

public CommonTree()

CommonTree

public CommonTree(CommonTree node)

CommonTree

public CommonTree(Token t)
Method Detail

getToken

public Token getToken()

dupNode

public Tree dupNode()

isNil

public boolean isNil()
Description copied from interface: Tree
Indicates the node is a nil node but may still have children, meaning the tree is a flat list.

Specified by:
isNil in interface Tree
Overrides:
isNil in class BaseTree

getType

public int getType()
Description copied from interface: Tree
Return a token type; needed for tree parsing


getText

public java.lang.String getText()

getLine

public int getLine()
Description copied from interface: Tree
In case we don't have a token payload, what is the line for errors?

Specified by:
getLine in interface Tree
Overrides:
getLine in class BaseTree

getCharPositionInLine

public int getCharPositionInLine()
Specified by:
getCharPositionInLine in interface Tree
Overrides:
getCharPositionInLine in class BaseTree

getTokenStartIndex

public int getTokenStartIndex()
Description copied from interface: Tree
What is the smallest token index (indexing from 0) for this node and its children?


setTokenStartIndex

public void setTokenStartIndex(int index)

getTokenStopIndex

public int getTokenStopIndex()
Description copied from interface: Tree
What is the largest token index (indexing from 0) for this node and its children?


setTokenStopIndex

public void setTokenStopIndex(int index)

toString

public java.lang.String toString()
Description copied from class: BaseTree
Override to say how a node (not a tree) should look as text

Specified by:
toString in interface Tree
Specified by:
toString in class BaseTree