Public Member Functions | Public Attributes | Private Member Functions
rve_interface_gen.antlr3.tree.CommonTreeNodeStream Class Reference
Inheritance diagram for rve_interface_gen.antlr3.tree.CommonTreeNodeStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __iter__
 iterator interface
def __str__
def addNavigationNode
def consume
def fillBuffer
def get
def getCurrentSymbol
def getNodeIndex
def getSourceName
def getTokenStream
def getTreeAdaptor
def getTreeSource
def hasUniqueNavigationNodes
def index
def LA
def LB
def LT
def mark
def pop
def push
def release
def replaceChildren
def reset
def rewind
def seek
def setTokenStream
def setUniqueNavigationNodes
def size
def toString

Public Attributes

 adaptor
 calls
 down
 eof
 lastMarker
 nodes
 p
 root
 tokens
 uniqueNavigationNodes
 up

Private Member Functions

def _fillBuffer

Detailed Description

@brief A buffered stream of tree nodes.

Nodes can be from a tree of ANY kind.

This node stream sucks all nodes out of the tree specified in
the constructor during construction and makes pointers into
the tree using an array of Object pointers. The stream necessarily
includes pointers to DOWN and UP and EOF nodes.

This stream knows how to mark/release for backtracking.

This stream is most suitable for tree interpreters that need to
jump around a lot or for tree parsers requiring speed (at cost of memory).
There is some duplicated functionality here with UnBufferedTreeNodeStream
but just in bookkeeping, not tree walking etc...

@see UnBufferedTreeNodeStream

Definition at line 1740 of file tree.py.


Constructor & Destructor Documentation

Definition at line 1760 of file tree.py.


Member Function Documentation

iterator interface

Definition at line 2146 of file tree.py.

Used for testing, just return the token type stream

Definition at line 2074 of file tree.py.

Definition at line 1859 of file tree.py.

As we flatten the tree, we use UP, DOWN nodes to represent
the tree structure.  When debugging we need unique nodes
so instantiate new ones when uniqueNavigationNodes is true.

Definition at line 1894 of file tree.py.

Definition at line 1987 of file tree.py.

Walk tree with depth-first-search and fill nodes buffer.
Don't do DOWN, UP nodes if its a list (t is isNil).

Definition at line 1850 of file tree.py.

Get a tree node at an absolute index i; 0..n-1.
If you don't want to buffer up nodes, then this method makes no
sense for you.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1920 of file tree.py.

Definition at line 1943 of file tree.py.

What is the stream index for node? 0..n-1
Return -1 if node not found.

Definition at line 1879 of file tree.py.

Definition at line 1963 of file tree.py.

If the tree associated with this stream was created from a TokenStream,
you can specify it here.  Used to do rule $text attribute in tree
parser.  Optional unless you use tree parser rule text attribute
or output=template and rewrite=true options.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1967 of file tree.py.

What adaptor can tell me how to interpret/navigate nodes and
trees.  E.g., get text of a node.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1975 of file tree.py.

Where is this stream pulling nodes from?  This is not the name, but
the object that provides node objects.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1959 of file tree.py.

Definition at line 1979 of file tree.py.

Definition at line 2013 of file tree.py.

Definition at line 1994 of file tree.py.

Look backwards k nodes

Definition at line 1947 of file tree.py.

Get tree node at current input pointer + i ahead where i=1 is next node.
i<0 indicates nodes in the past.  So LT(-1) is previous node, but
implementations are not required to provide results for k < -1.
LT(0) is undefined.  For i>=n, return null.
Return null for LT(0) and any index that results in an absolute address
that is negative.

This is analogus to the LT() method of the TokenStream, but this
returns a tree node instead of a token.  Makes code gen identical
for both parser and tree grammars. :)

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1927 of file tree.py.

Definition at line 1998 of file tree.py.

Seek back to previous index saved during last push() call.
Return top of stack (return index).

Definition at line 2041 of file tree.py.

Make stream jump to a new location, saving old location.
Switch back with pop().

Definition at line 2031 of file tree.py.

Definition at line 2007 of file tree.py.

def rve_interface_gen.antlr3.tree.CommonTreeNodeStream.replaceChildren (   self,
  parent,
  startChildIndex,
  stopChildIndex,
  t 
)
Replace from start to stop child index of parent with t, which might
be a list.  Number of children may be different
after this call.  The stream is notified because it is walking the
tree and might need to know you are monkeying with the underlying
tree.  Also, it might be able to modify the node stream to avoid
restreaming for future phases.

If parent is null, don't do anything; must be at root of overall tree.
Can't replace whatever points to the parent externally.  Do nothing.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 2067 of file tree.py.

Definition at line 2052 of file tree.py.

Definition at line 2017 of file tree.py.

Definition at line 2024 of file tree.py.

Definition at line 1971 of file tree.py.

As we flatten the tree, we use UP, DOWN nodes to represent
the tree structure.  When debugging we need unique nodes
so we have to instantiate new ones.  When doing normal tree
parsing, it's slow and a waste of memory to create unique
navigation nodes.  Default should be false;

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 1983 of file tree.py.

Definition at line 2058 of file tree.py.

Return the text of all nodes from start to stop, inclusive.
If the stream does not buffer all the nodes then it can still
walk recursively from start until stop.  You can always return
null or "" too, but users should not access $ruleLabel.text in
an action of course in that case.

Reimplemented from rve_interface_gen.antlr3.tree.TreeNodeStream.

Definition at line 2085 of file tree.py.


Member Data Documentation

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 of file tree.py.

Definition at line 1760 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