Public Member Functions | |
def | __init__ |
def | dupNode |
def | getCharPositionInLine |
def | getChildIndex |
def | getLine |
def | getParent |
def | getText |
def | getToken |
def | getTokenStartIndex |
def | getTokenStopIndex |
def | getType |
def | isNil |
def | setChildIndex |
def | setParent |
def | setTokenStartIndex |
def | setTokenStopIndex |
def | setUnknownTokenBoundaries |
def | toString |
def | toStringTree |
Public Attributes | |
childIndex | |
parent | |
startIndex | |
stopIndex | |
token | |
Properties | |
charPositionInLine = property(getCharPositionInLine) | |
line = property(getLine) | |
text = property(getText) | |
tokenStartIndex = property(getTokenStartIndex, setTokenStartIndex) | |
tokenStopIndex = property(getTokenStopIndex, setTokenStopIndex) | |
type = property(getType) | |
Static Private Attributes | |
__str__ = toString |
@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.
def rve_interface_gen.antlr3.tree.CommonTree.__init__ | ( | self, | |
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.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
def rve_interface_gen.antlr3.tree.CommonTree.dupNode | ( | self | ) |
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
BaseTree doesn't track child indexes.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
def rve_interface_gen.antlr3.tree.CommonTree.getLine | ( | self | ) |
In case we don't have a token payload, what is the line for errors?
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
BaseTree doesn't track parent pointers.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
def rve_interface_gen.antlr3.tree.CommonTree.getText | ( | self | ) |
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode.
What is the smallest token index (indexing from 0) for this node and its children?
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
What is the largest token index (indexing from 0) for this node and its children?
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
def rve_interface_gen.antlr3.tree.CommonTree.getType | ( | self | ) |
Return a token type; needed for tree parsing.
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode.
def rve_interface_gen.antlr3.tree.CommonTree.isNil | ( | self | ) |
Indicates the node is a nil node but may still have children, meaning the tree is a flat list.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode.
def rve_interface_gen.antlr3.tree.CommonTree.setChildIndex | ( | self, | |
index | |||
) |
BaseTree doesn't track child indexes.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
def rve_interface_gen.antlr3.tree.CommonTree.setParent | ( | self, | |
t | |||
) |
BaseTree doesn't track parent pointers.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
def rve_interface_gen.antlr3.tree.CommonTree.setTokenStartIndex | ( | self, | |
index | |||
) |
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
def rve_interface_gen.antlr3.tree.CommonTree.setTokenStopIndex | ( | self, | |
index | |||
) |
Reimplemented from rve_interface_gen.antlr3.tree.Tree.
Override to say how a node (not a tree) should look as text
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode.
Print out a whole tree not just a node
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
rve_interface_gen::antlr3::tree.CommonTree::__str__ = toString [static, private] |
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
Reimplemented from rve_interface_gen.antlr3.tree.BaseTree.
rve_interface_gen::antlr3::tree.CommonTree::charPositionInLine = property(getCharPositionInLine) [static] |
rve_interface_gen::antlr3::tree.CommonTree::line = property(getLine) [static] |
rve_interface_gen::antlr3::tree.CommonTree::text = property(getText) [static] |
rve_interface_gen::antlr3::tree.CommonTree::tokenStartIndex = property(getTokenStartIndex, setTokenStartIndex) [static] |
rve_interface_gen::antlr3::tree.CommonTree::tokenStopIndex = property(getTokenStopIndex, setTokenStopIndex) [static] |
rve_interface_gen::antlr3::tree.CommonTree::type = property(getType) [static] |