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".
charPositionInLine:int
[read-only]Implementation
public function get charPositionInLine():int
childCount:int
[read-only]Implementation
public function get childCount():int
childIndex:int
[read-write]
BaseTree doesn't track child indexes.
Implementation
public function get childIndex():int
public function set childIndex(value:int):void
protected var _children:Array
children:Array
[read-only]
Get the children internal List; note that if you directly mess with
the list, do so at your own risk.
Implementation
public function get children():Array
isNil:Boolean
[read-only]Implementation
public function get isNil():Boolean
line:int
[read-only]Implementation
public function get line():int
parent:Tree
[read-write]
BaseTree doesn't track parent pointers.
Implementation
public function get parent():Tree
public function set parent(value:Tree):void
text:String
[read-only]Implementation
public function get text():String
tokenStartIndex:int
[read-write]Implementation
public function get tokenStartIndex():int
public function set tokenStartIndex(value:int):void
tokenStopIndex:int
[read-write]Implementation
public function get tokenStopIndex():int
public function set tokenStopIndex(value:int):void
type:int
[read-only]Implementation
public function get type():int
public function BaseTree(node:Tree = null)
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.
Parameters
| node:Tree (default = null )
|
public function addChild(t:Tree):void
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.
Parameters
public function addChildren(kids:Array):void
Add all elements of kids list as children of this node
Parameters
public function deleteChild(i:int):Object
Parameters
Returns
public function dupNode():Tree
Returns
public function freshenParentAndChildIndexes():void
Set the parent and child index values for all child of t
public function freshenParentAndChildIndexesFrom(offset:int):void
Parameters
public function getChild(i:int):Tree
Parameters
Returns
public function getFirstChildWithType(type:int):Tree
Parameters
Returns
public function replaceChildren(startChildIndex:int, stopChildIndex:int, t:Object):void
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.
Parameters
| startChildIndex:int |
|
| stopChildIndex:int |
|
| t:Object |
public function sanityCheckParentAndChildIndexes():void
public function sanityCheckParentAndChildIndexesFrom(parent:Tree, i:int):void
Parameters
public function setChild(i:int, t:Tree):void
Parameters
public function toStringTree():String
Print out a whole tree not just a node
Returns