@brief A tree node that is wrapper for a Token object.
After 3.0 release while building tree rewrite stuff, it became clear
that computing parent and child index is very difficult and cumbersome.
Better to spend the space in every tree node. If you don't want these
extra fields, it's easy to cut them out in your own BaseTree
subclass.
|
__init__(self,
payload)
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. |
|
|
|
|
|
|
|
isNil(self)
Indicates the node is a nil node but may still have children, meaning
the tree is a flat list. |
|
|
|
getType(self)
Return a token type; needed for tree parsing. |
|
|
|
|
|
getLine(self)
In case we don't have a token payload, what is the line for errors? |
|
|
|
|
|
getTokenStartIndex(self)
What is the smallest token index (indexing from 0) for this node... |
|
|
|
|
|
getTokenStopIndex(self)
What is the largest token index (indexing from 0) for this node and
its children? |
|
|
|
|
|
|
|
|
|
|
|
getParent(self)
BaseTree doesn't track parent pointers. |
|
|
|
setParent(self,
t)
BaseTree doesn't track parent pointers. |
|
|
|
toString(self)
Override to say how a node (not a tree) should look as text |
|
|
|
__str__(self)
Override to say how a node (not a tree) should look as text |
|
|
|
|
Inherited from BaseTree :
addChild ,
addChildren ,
deleteChild ,
freshenParentAndChildIndexes ,
getAncestor ,
getAncestors ,
getChild ,
getChildCount ,
getChildren ,
getFirstChildWithType ,
hasAncestor ,
replaceChildren ,
sanityCheckParentAndChildIndexes ,
setChild
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|