antlr3-UP (3) - Linux Manuals

NAME

ANTLR3_COMMON_TREE_NODE_STREAM_struct -

SYNOPSIS


#include <antlr3commontreenodestream.h>

Data Fields


ANTLR3_MARKER absoluteNodeIndex
What node index did we just consume? i=0..n-1 for n node trees.
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_TREE * lookAhead
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

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(), and fillBuffer().

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)

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

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

ANTLR3_UINT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize)(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)

Referenced by antlr3CommonTreeNodeStreamNewStream().

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)

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::head

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

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

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)

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode)(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

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

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(), 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 antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), fillBufferRoot(), LB(), and reset().

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

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)

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset)(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)

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

pANTLR3_BASE_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::root

Which tree are we navigating ?

Referenced by antlr3CommonTreeNodeStreamNewStream(), antlr3CommonTreeNodeStreamNewTree(), and fillBufferRoot().

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

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.

pANTLR3_TREE_NODE_STREAM ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream

Pointer to the tree node stream interface.

Referenced by alreadyParsedRule(), antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3RecognitionExceptionNew(), consumeUntil(), consumeUntilSet(), displayRecognitionError(), match(), matchAny(), memoize(), recover(), recoverFromMismatchedElement(), recoverFromMismatchedSet(), recoverFromMismatchedToken(), reset(), and synpred().

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

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

Author

Generated automatically by Doxygen for ANTLR3C from the source code.