ANTLR3_COMMON_TREE_NODE_STREAM_struct Struct Reference

#include <antlr3commontreenodestream.h>

Collaboration diagram for ANTLR3_COMMON_TREE_NODE_STREAM_struct:

Collaboration graph
[legend]

Data Fields

ANTLR3_MARKER absoluteNodeIndex
 What node index did we just consume? i=0.
pANTLR3_BASE_TREE_ADAPTOR adaptor
 Pointer to tree adaptor interface that manipulates/builds the tree.
void(* addLookahead )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, pANTLR3_BASE_TREE node)
void(* addNavigationNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 ttype)
ANTLR3_INT32 currentChildIndex
 Which child are we currently visiting? If -1 we have not visited this node yet; next consume() request will set currentIndex to 0.
pANTLR3_BASE_TREE currentNode
 Which node are we currently visiting?
ANTLR3_COMMON_TREE DOWN
 Dummy tree node that indicates a descent into a child tree.
ANTLR3_COMMON_TREE EOF_NODE
 Dummy tree node that indicates the termination point of the tree.
void(* fill )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 k)
void(* free )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_UINT32(* getLookaheadSize )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* handleRootnode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_BOOLEAN(* hasNext )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_BOOLEAN(* hasUniqueNavigationNodes )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_UINT32 head
 lookAhead[head] is the first symbol of lookahead, LT(1).
ANTLR3_COMMON_TREE INVALID_NODE
 Dummy node that is returned if we need to indicate an invalid node for any reason.
ANTLR3_BOOLEAN isRewriter
 Indicates whether this node stream was derived from a prior node stream to be used by a rewriting tree parser for instance.
pANTLR3_BASE_TREElookAhead
 Buffer tree node stream for use with LT(i).
ANTLR3_UINT32 lookAheadLength
 Number of elements available in the lookahead buffer at any point in time.
pANTLR3_VECTOR markers
 Calls to mark() may be nested so we have to track a stack of them.
pANTLR3_BASE_TREE(* newDownNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* newUpNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* next )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_VECTOR nodes
 The complete mapping from stream index to tree node.
pANTLR3_STACK nodeStack
 As we walk down the nodes, we must track parent nodes so we know where to go after walking the last child of a node.
ANTLR3_INT32 p
 The current index into the nodes vector of the current tree we are parsing and possibly rewriting.
ANTLR3_INT32(* pop )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE previousNode
 Which node did we last visit? Used for LT(-1).
void(* push )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 index)
void(* reset )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE root
 Which tree are we navigating ?
pANTLR3_STRING_FACTORY stringFactory
 String factory for use by anything that wishes to create strings such as a tree representation or some copy of the text etc.
void * super
 Any interface that implements this interface (is a super structure containing this structure), may store the pointer to itself here in the super pointer, which is not used by the common tree node stream.
ANTLR3_UINT32 tail
 Add new lookahead at lookahead[tail].
pANTLR3_TREE_NODE_STREAM tnstream
 Pointer to the tree node stream interface.
ANTLR3_BOOLEAN uniqueNavigationNodes
 If set to ANTLR3_TRUE then the navigation nodes UP, DOWN are duplicated rather than reused within the tree.
ANTLR3_COMMON_TREE UP
 Dummy tree node that indicates a descent up to a parent tree.
pANTLR3_BASE_TREE(* visitChild )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 child)
void(* walkBackToMostRecentNodeWithUnvisitedChildren )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)

Field Documentation

What node index did we just consume? i=0.

.n-1 for n node trees. IntStream.next is hence 1 + this value. Size will be same.

Pointer to tree adaptor interface that manipulates/builds the tree.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and fillBuffer().

Which child are we currently visiting? If -1 we have not visited this node yet; next consume() request will set currentIndex to 0.

Which node are we currently visiting?

Dummy tree node that indicates a descent into a child tree.

Initialized by a call to create a new interface.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Dummy tree node that indicates the termination point of the tree.

Initialized by a call to create a new interface.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and getMissingSymbol().

lookAhead[head] is the first symbol of lookahead, LT(1).

Dummy node that is returned if we need to indicate an invalid node for any reason.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and LB().

Indicates whether this node stream was derived from a prior node stream to be used by a rewriting tree parser for instance.

If this flag is set to ANTLR3_TRUE, then when this stream is closed it will not free the root tree as this tree always belongs to the origniating node stream.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNewStream(), and reset().

Buffer tree node stream for use with LT(i).

This list grows to fit new lookahead depths, but consume() wraps like a circular buffer.

Number of elements available in the lookahead buffer at any point in time.

This is the current size of the array.

Calls to mark() may be nested so we have to track a stack of them.

The marker is an index into this stack. Index 0 is the first marker. This is a List<TreeWalkState>

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

The complete mapping from stream index to tree node.

This buffer includes pointers to DOWN, UP, and EOF nodes. It is built upon ctor invocation. The elements are type Object as we don't what the trees look like.

Load upon first need of the buffer so we can set token types of interest for reverseIndexing. Slows us down a wee bit to do all of the if p==-1 testing everywhere though, though in C you won't really be able to measure this.

Must be freed when the tree node stream is torn down.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), fillBuffer(), and LB().

As we walk down the nodes, we must track parent nodes so we know where to go after walking the last child of a node.

When visiting a child, push current node and current index (current index is first stored in the tree node structure to avoid two stacks.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and reset().

The current index into the nodes vector of the current tree we are parsing and possibly rewriting.

Referenced by antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), fillBufferRoot(), LB(), and reset().

Which node did we last visit? Used for LT(-1).

String factory for use by anything that wishes to create strings such as a tree representation or some copy of the text etc.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Any interface that implements this interface (is a super structure containing this structure), may store the pointer to itself here in the super pointer, which is not used by the common tree node stream.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Add new lookahead at lookahead[tail].

tail wraps around at the end of the lookahead buffer so tail could be less than head.

If set to ANTLR3_TRUE then the navigation nodes UP, DOWN are duplicated rather than reused within the tree.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Dummy tree node that indicates a descent up to a parent tree.

Initialized by a call to create a new interface.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().


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

Generated on Mon Nov 29 17:24:04 2010 for ANTLR3C by  doxygen 1.5.5