| java.lang.Object org.antlr.runtime.tree.BaseTree
All known Subclasses: org.antlr.runtime.tree.ParseTree, org.antlr.runtime.tree.DoubleLinkTree, org.antlr.runtime.tree.CommonTree,
BaseTree | abstract public class BaseTree implements Tree(Code) | | A generic tree implementation with no payload. You must subclass to
actually have any user data. ANTLR v3 uses a list of children approach
instead of the child-sibling approach in v2. A flat tree (a list) is
an empty node whose children represent the list. An empty, but
non-null node is called "nil".
|
Constructor Summary | |
public | BaseTree() | public | BaseTree(Tree node) Create a new node from an existing node does nothing for BaseTree
as there are no fields other than the children list, which cannot
be copied as the children are not considered part of this node. |
BaseTree | public BaseTree()(Code) | | |
BaseTree | public BaseTree(Tree node)(Code) | | Create a new node from an existing node does nothing for BaseTree
as there are no fields other than the children list, which cannot
be copied as the children are not considered part of this node.
|
addChild | public void addChild(Tree t)(Code) | | Add t as child of this node.
Warning: if t has no children, but child does
and child isNil then this routine moves children to t via
t.children = child.children; i.e., without copying the array.
|
addChildren | public void addChildren(List kids)(Code) | | Add all elements of kids list as children of this node
|
createChildrenList | protected List createChildrenList()(Code) | | Override in a subclass to change the impl of children list
|
dupTree | public Tree dupTree()(Code) | | Recursively walk this tree, dup'ing nodes until you have copy of
this tree. This method should work for all subclasses as long
as they override dupNode().
|
getCharPositionInLine | public int getCharPositionInLine()(Code) | | |
getChildCount | public int getChildCount()(Code) | | |
getFirstChildWithType | public Tree getFirstChildWithType(int type)(Code) | | |
getLine | public int getLine()(Code) | | |
isNil | public boolean isNil()(Code) | | |
toString | abstract public String toString()(Code) | | Override to say how a node (not a tree) should look as text
|
toStringTree | public String toStringTree()(Code) | | Print out a whole tree not just a node
|
|
|