BaseTree doesn't track child indexes.
Get the children internal List; note that if you directly mess with the list, do so at your own risk.
BaseTree doesn't track parent pointers.
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.
Set the parent and child index values for all child of t
Walk upwards and get first ancestor with this token type.
Walk upwards looking for ancestor with this token type.
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.
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.
Override to say how a node (not a tree) should look as text
Print out a whole tree not just a node
Generated using TypeDoc
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".