ANTLR3C  3.3.1
ANTLR3_COMMON_TREE_NODE_STREAM_struct Struct Reference

#include <antlr3commontreenodestream.h>

Collaboration diagram for ANTLR3_COMMON_TREE_NODE_STREAM_struct:

Data Fields

ANTLR3_MARKER absoluteNodeIndex
 What node index did we just consume? i=0..n-1 for n node trees. More...
 
pANTLR3_BASE_TREE_ADAPTOR adaptor
 Pointer to tree adaptor interface that manipulates/builds the tree. More...
 
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. More...
 
pANTLR3_BASE_TREE currentNode
 Which node are we currently visiting? More...
 
ANTLR3_COMMON_TREE DOWN
 Dummy tree node that indicates a descent into a child tree. More...
 
ANTLR3_COMMON_TREE EOF_NODE
 Dummy tree node that indicates the termination point of the tree. More...
 
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). More...
 
ANTLR3_COMMON_TREE INVALID_NODE
 Dummy node that is returned if we need to indicate an invalid node for any reason. More...
 
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. More...
 
pANTLR3_BASE_TREElookAhead
 Buffer tree node stream for use with LT(i). More...
 
ANTLR3_UINT32 lookAheadLength
 Number of elements available in the lookahead buffer at any point in time. More...
 
pANTLR3_VECTOR markers
 Calls to mark() may be nested so we have to track a stack of them. More...
 
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. More...
 
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. More...
 
ANTLR3_INT32 p
 The current index into the nodes vector of the current tree we are parsing and possibly rewriting. More...
 
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) More...
 
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 ? More...
 
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. More...
 
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. More...
 
ANTLR3_UINT32 tail
 Add new lookahead at lookahead[tail]. More...
 
pANTLR3_TREE_NODE_STREAM tnstream
 Pointer to the tree node stream interface. More...
 
ANTLR3_BOOLEAN uniqueNavigationNodes
 If set to ANTLR3_TRUE then the navigation nodes UP, DOWN are duplicated rather than reused within the tree. More...
 
ANTLR3_COMMON_TREE UP
 Dummy tree node that indicates a descent up to a parent tree. More...
 
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

ANTLR3_MARKER ANTLR3_COMMON_TREE_NODE_STREAM_struct::absoluteNodeIndex

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.

pANTLR3_BASE_TREE_ADAPTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor

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

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

void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::addLookahead) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, pANTLR3_BASE_TREE node)
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 ttype)
ANTLR3_INT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::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 ANTLR3_COMMON_TREE_NODE_STREAM_struct::currentNode

Which node are we currently visiting?

ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN

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

Initialized by a call to create a new interface.

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

ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE

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

Initialized by a call to create a new interface.

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

void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::fill) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 k)
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::free) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_UINT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::handleRootnode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_BOOLEAN(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasNext) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_BOOLEAN(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::head

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

Referenced by getLookaheadSize().

ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE

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

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

ANTLR3_BOOLEAN ANTLR3_COMMON_TREE_NODE_STREAM_struct::isRewriter

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().

pANTLR3_BASE_TREE* ANTLR3_COMMON_TREE_NODE_STREAM_struct::lookAhead

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

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

ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::lookAheadLength

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

This is the current size of the array.

Referenced by getLookaheadSize().

pANTLR3_VECTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::markers

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().

pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::next) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_VECTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes

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 _LT(), addNavigationNode(), antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), fillBuffer(), get(), LB(), and size().

pANTLR3_STACK ANTLR3_COMMON_TREE_NODE_STREAM_struct::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.

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(), pop(), push(), and reset().

ANTLR3_INT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::p

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

Referenced by _LT(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), consume(), fillBufferRoot(), get(), LB(), mark(), push(), reset(), seek(), size(), and tindex().

ANTLR3_INT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::previousNode

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

void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::push) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 index)
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)
pANTLR3_BASE_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::root
pANTLR3_STRING_FACTORY ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory

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(), antlr3CommonTreeNodeStreamNewStream(), toStringSS(), and toStringWork().

void* ANTLR3_COMMON_TREE_NODE_STREAM_struct::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.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::tail

Add new lookahead at lookahead[tail].

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

Referenced by getLookaheadSize().

ANTLR3_BOOLEAN ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes

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

Referenced by antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), hasUniqueNavigationNodes(), and setUniqueNavigationNodes().

ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP

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

Initialized by a call to create a new interface.

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

pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::visitChild) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 child)
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::walkBackToMostRecentNodeWithUnvisitedChildren) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)

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