| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected List | |
| public Object | |
| public void | freshenParentAndChildIndexes()
Implements org. |
| public void | |
| public void | |
| public void | |
| public Tree | getAncestor(int ttype)
Implements org. |
| public List | getAncestors()
Implements org. |
| public int | |
| public Tree | |
| public int | |
| public int | getChildIndex()
Implements org. |
| public List | getChildren()
Get the children internal List; note that if you directly mess with the list, do so at your own risk. |
| public Tree | |
| public int | getLine()
Implements org. |
| public Tree | getParent()
Implements org. |
| public boolean | hasAncestor(int ttype)
Implements org. |
| public void | insertChild(int i, Object t)
Insert child t at child position i (0..n-1) by shifting children i+1..n-1 to the right one position. |
| public boolean | isNil()
Implements org. |
| public void | replaceChildren(int startChildIndex, int stopChildIndex, Object t)
Implements org. |
| public void | |
| public void | |
| public void | setChild(int i, Tree t)
Implements org. |
| public void | |
| public void | |
| public abstract String | toString()
Redeclares org. Overrides java. |
| public String | toStringTree()
Implements org. |
| children | back to summary |
|---|---|
| protected List<Object> children | |
| BaseTree | back to summary |
|---|---|
| public BaseTree() | |
| BaseTree | back to summary |
|---|---|
| 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. | |
| addChild | back to summary |
|---|---|
| public void addChild(Tree t) Implements org. 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 | back to summary |
|---|---|
| public void addChildren(List<? extends Tree> kids) Add all elements of kids list as children of this node | |
| createChildrenList | back to summary |
|---|---|
| protected List Override in a subclass to change the impl of children list | |
| deleteChild | back to summary |
|---|---|
| public Object deleteChild(int i) Implements org.
| |
| freshenParentAndChildIndexes | back to summary |
|---|---|
| public void freshenParentAndChildIndexes() Implements org. Set the parent and child index values for all child of t
| |
| freshenParentAndChildIndexes | back to summary |
|---|---|
| public void freshenParentAndChildIndexes(int offset) | |
| freshenParentAndChildIndexesDeeply | back to summary |
|---|---|
| public void freshenParentAndChildIndexesDeeply() | |
| freshenParentAndChildIndexesDeeply | back to summary |
|---|---|
| public void freshenParentAndChildIndexesDeeply(int offset) | |
| getAncestor | back to summary |
|---|---|
| public Tree getAncestor(int ttype) Implements org. Walk upwards and get first ancestor with this token type.
| |
| getAncestors | back to summary |
|---|---|
| public List Implements org. Return a list of all ancestors of this node. The first node of list is the root and the last is the parent of this node.
| |
| getCharPositionInLine | back to summary |
|---|---|
| public int getCharPositionInLine() Implements org.
| |
| getChild | back to summary |
|---|---|
| public Tree getChild(int i) Implements org.
| |
| getChildCount | back to summary |
|---|---|
| public int getChildCount() Implements org.
| |
| getChildIndex | back to summary |
|---|---|
| public int getChildIndex() Implements org. BaseTree doesn't track child indexes.
| |
| getChildren | back to summary |
|---|---|
| public List Get the children internal List; note that if you directly mess with the list, do so at your own risk. | |
| getFirstChildWithType | back to summary |
|---|---|
| public Tree getFirstChildWithType(int type) | |
| getLine | back to summary |
|---|---|
| public int getLine() Implements org. Doc from org. In case we don't have a token payload, what is the line for errors?
| |
| getParent | back to summary |
|---|---|
| public Tree getParent() Implements org. BaseTree doesn't track parent pointers.
| |
| hasAncestor | back to summary |
|---|---|
| public boolean hasAncestor(int ttype) Implements org. Walk upwards looking for ancestor with this token type.
| |
| insertChild | back to summary |
|---|---|
| public void insertChild(int i, Object t) Insert child t at child position i (0..n-1) by shifting children i+1..n-1 to the right one position. Set parent / indexes properly but does NOT collapse nil-rooted t's that come in here like addChild. | |
| isNil | back to summary |
|---|---|
| public boolean isNil() Implements org. Doc from org. Indicates the node is a nil node but may still have children, meaning the tree is a flat list.
| |
| replaceChildren | back to summary |
|---|---|
| public void replaceChildren(int startChildIndex, int stopChildIndex, Object t) Implements org. Delete children from start to stop and replace with t even if t is a list (nil-root tree). num of children can increase or decrease. For huge child lists, inserting children can force walking rest of children to set their childindex; could be slow.
| |
| sanityCheckParentAndChildIndexes | back to summary |
|---|---|
| public void sanityCheckParentAndChildIndexes() | |
| sanityCheckParentAndChildIndexes | back to summary |
|---|---|
| public void sanityCheckParentAndChildIndexes(Tree parent, int i) | |
| setChild | back to summary |
|---|---|
| public void setChild(int i, Tree t) Implements org. Doc from org. Set ith child (0..n-1) to t; t must be non-null and non-nil node
| |
| setChildIndex | back to summary |
|---|---|
| public void setChildIndex(int index) Implements org.
| |
| setParent | back to summary |
|---|---|
| public void setParent(Tree t) Implements org.
| |
| toString | back to summary |
|---|---|
| public abstract String toString() Redeclares org. Overrides java. Override to say how a node (not a tree) should look as text
| |
| toStringTree | back to summary |
|---|---|
| public String toStringTree() Implements org. Print out a whole tree not just a node
| |