Public Member Functions | Public Attributes
rve_interface_gen.antlr3.tree.BaseTree Class Reference

warnings.warn( "Using create() is deprecated, use createWithPayload()", DeprecationWarning, stacklevel=2 ) More...

Inheritance diagram for rve_interface_gen.antlr3.tree.BaseTree:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def addChild
def addChildren
def deleteChild
def freshenParentAndChildIndexes
def getAncestor
def getAncestors
def getCharPositionInLine
def getChild
def getChildCount
def getChildIndex
def getChildren
def getFirstChildWithType
def getLine
def getParent
def hasAncestor
def isNil
def replaceChildren
def sanityCheckParentAndChildIndexes
def setChild
def setChildIndex
def setParent
def toString
def toStringTree

Public Attributes

 childIndex
 children
 parent

Detailed Description

warnings.warn( "Using create() is deprecated, use createWithPayload()", DeprecationWarning, stacklevel=2 )

warnings.warn( "Using create() is deprecated, use createFromToken()", DeprecationWarning, stacklevel=2 ) warnings.warn( "Using create() is deprecated, use createFromToken()", DeprecationWarning, stacklevel=2 ) warnings.warn( "Using create() is deprecated, use createFromType()", DeprecationWarning, stacklevel=2 )

base implementation of Tree and TreeAdaptor

Tree \- BaseTree

TreeAdaptor \- BaseTreeAdaptor

@brief 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".

Definition at line 671 of file tree.py.


Constructor & Destructor Documentation

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 in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 686 of file tree.py.


Member Function Documentation

def rve_interface_gen.antlr3.tree.BaseTree.addChild (   self,
  childTree 
)
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.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 729 of file tree.py.

Add all elements of kids list as children of this node

Definition at line 763 of file tree.py.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 781 of file tree.py.

Definition at line 843 of file tree.py.

Walk upwards and get first ancestor with this token type.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 893 of file tree.py.

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.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 903 of file tree.py.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 948 of file tree.py.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 699 of file tree.py.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 725 of file tree.py.

BaseTree doesn't track child indexes.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 866 of file tree.py.

@brief Get the children internal List

Note that if you directly mess with
the list, do so at your own risk.

Definition at line 706 of file tree.py.

Definition at line 717 of file tree.py.

In case we don't have a token payload, what is the line for errors?

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 944 of file tree.py.

BaseTree doesn't track parent pointers.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 878 of file tree.py.

Walk upwards looking for ancestor with this token type.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 889 of file tree.py.

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.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode, and rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 839 of file tree.py.

def rve_interface_gen.antlr3.tree.BaseTree.replaceChildren (   self,
  startChildIndex,
  stopChildIndex,
  newTree 
)
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.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 793 of file tree.py.

Definition at line 849 of file tree.py.

def rve_interface_gen.antlr3.tree.BaseTree.setChild (   self,
  i,
  t 
)
Set ith child (0..n-1) to t; t must be non-null and non-nil node

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Definition at line 769 of file tree.py.

BaseTree doesn't track child indexes.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 872 of file tree.py.

BaseTree doesn't track parent pointers.

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 883 of file tree.py.

Override to say how a node (not a tree) should look as text

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonErrorNode, and rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 952 of file tree.py.

Print out a whole tree not just a node

Reimplemented from rve_interface_gen.antlr3.tree.Tree.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 921 of file tree.py.


Member Data Documentation

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 690 of file tree.py.

Definition at line 690 of file tree.py.

Reimplemented in rve_interface_gen.antlr3.tree.CommonTree.

Definition at line 690 of file tree.py.


The documentation for this class was generated from the following file:


rve_interface_gen
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:31:00