antlr3commontreenodestream.c man page

src/antlr3commontreenodestream.c — Defines the implementation of the common node stream the default tree node stream used by ANTLR.

Synopsis

#include <antlr3commontreenodestream.h>

Functions

static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i)

static pANTLR3_BASE_TREE _LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k)
Get tree node at current input pointer + i ahead where i=1 is next node.
static void addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype)
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure.
static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns)
Free up any resources that belong to this common tree node stream.
ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint)

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream)

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint)

static void antlr3TreeNodeStreamFree (pANTLR3_TREE_NODE_STREAM tns)

ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew ()

static void consume (pANTLR3_INT_STREAM is)
Consume the next node from the input stream.
static void fillBuffer (pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t)
Walk tree with depth-first-search and fill nodes buffer.
static void fillBufferRoot (pANTLR3_COMMON_TREE_NODE_STREAM ctns)
Walk and fill the tree node buffer from the root tree.
static pANTLR3_BASE_TREE get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k)

static ANTLR3_UINT32 getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns)

static pANTLR3_BASE_TREE_ADAPTOR getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns)

static pANTLR3_BASE_TREE getTreeSource (pANTLR3_TREE_NODE_STREAM tns)
Where is this stream pulling nodes from? This is not the name, but the object that provides node objects.
static ANTLR3_BOOLEAN hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns)

static pANTLR3_BASE_TREE LB (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k)

static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is)
Mark the state of the input stream so that we can come back to it after a syntactic predicate and so on.
static pANTLR3_BASE_TREE newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns)

static pANTLR3_BASE_TREE newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns)

static ANTLR3_INT32 pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns)

static void push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index)

static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker)

static void replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t)
Replace from start to stop child index of parent with t, which might be a list.
static void reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns)
Reset the input stream to the start of the input nodes.
static void rewindLast (pANTLR3_INT_STREAM is)

static void rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker)
Rewind the current state of the tree walk to the state it was in when mark() was called and it returned marker.
static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index)
consume() ahead until we hit index.
static void setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes)

static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is)
Expensive to compute the size of the whole tree while parsing.
static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is)

static pANTLR3_STRING toString (pANTLR3_TREE_NODE_STREAM tns)
Print out the entire tree including DOWN/UP nodes.
static pANTLR3_STRING toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop)

static void toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf)

Detailed Description

Defines the implementation of the common node stream the default tree node stream used by ANTLR.

Function Documentation

static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) [static]

References ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_TOKEN_INVALID, ANTLR3_BASE_TREE_struct::getType, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_BASE_TREE _LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) [static]

Get tree node at current input pointer + i ahead where i=1 is next node. i<0 indicates nodes in the past. So -1 is previous node and -2 is two nodes ago. 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 analogous 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. :)

References ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_VECTOR_struct::count, ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, fillBufferRoot(), ANTLR3_VECTOR_struct::get, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, LB(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::p.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype) [static]

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.

References ANTLR3_VECTOR_struct::add, ANTLR3_TOKEN_DOWN, ANTLR3_TRUE, ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

Free up any resources that belong to this common tree node stream.

References ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, ANTLR3_FREE, ANTLR3_TRUE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_TREE_NODE_STREAM_struct::free, ANTLR3_BASE_TREE_ADAPTOR_struct::free, ANTLR3_INT_STREAM_struct::free, ANTLR3_STACK_struct::free, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::isRewriter, ANTLR3_TREE_NODE_STREAM_struct::istream, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream, ANTLR3_COMMON_TREE_struct::token, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint)

References _LA(), ANTLR3_INT_STREAM_struct::_LA, _LT(), ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, addNavigationNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode, ANTLR3_CALLOC, ANTLR3_COMMONTREENODE, ANTLR3_FALSE, ANTLR3_TEXT_CHARP, ANTLR3_TOKEN_DOWN, ANTLR3_TOKEN_EOF, ANTLR3_TOKEN_INVALID, ANTLR3_TOKEN_UP, ANTLR3_TREE_ADAPTORNew(), antlr3CommonTokenNew(), antlr3CommonTreeNodeStreamFree(), antlr3IntStreamNew(), antlr3SetCTAPI(), antlr3StackNew(), antlr3TreeNodeStreamNew(), antlr3VectorNew(), ANTLR3_COMMON_TOKEN_struct::chars, consume(), ANTLR3_INT_STREAM_struct::consume, ANTLR3_TREE_NODE_STREAM_struct::ctns, DEFAULT_INITIAL_BUFFER_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_TREE_NODE_STREAM_struct::free, ANTLR3_BASE_TREE_ADAPTOR_struct::free, ANTLR3_COMMON_TREE_NODE_STREAM_struct::free, ANTLR3_TREE_NODE_STREAM_struct::get, getTreeAdaptor(), ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor, getTreeSource(), ANTLR3_TREE_NODE_STREAM_struct::getTreeSource, hasUniqueNavigationNodes(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes, ANTLR3_INT_STREAM_struct::index, INITIAL_CALL_STACK_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_TREE_NODE_STREAM_struct::istream, mark(), ANTLR3_INT_STREAM_struct::mark, ANTLR3_COMMON_TREE_NODE_STREAM_struct::markers, newDownNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode, newUpNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, pop(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop, push(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::push, release(), ANTLR3_INT_STREAM_struct::release, reset(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset, ANTLR3_INT_STREAM_struct::rewind, rewindLast(), ANTLR3_INT_STREAM_struct::rewindLast, rewindMark(), seek(), ANTLR3_INT_STREAM_struct::seek, setUniqueNavigationNodes(), ANTLR3_TREE_NODE_STREAM_struct::setUniqueNavigationNodes, size(), ANTLR3_INT_STREAM_struct::size, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, ANTLR3_INT_STREAM_struct::super, ANTLR3_COMMON_TREE_NODE_STREAM_struct::super, ANTLR3_COMMON_TOKEN_struct::textState, tindex(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream, ANTLR3_COMMON_TREE_struct::token, ANTLR3_COMMON_TOKEN_struct::tokText, toString(), ANTLR3_TREE_NODE_STREAM_struct::toString, toStringSS(), ANTLR3_TREE_NODE_STREAM_struct::toStringSS, toStringWork(), ANTLR3_TREE_NODE_STREAM_struct::toStringWork, ANTLR3_INT_STREAM_struct::type, ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.

Referenced by antlr3CommonTreeNodeStreamNewTree().

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream)

References _LA(), ANTLR3_INT_STREAM_struct::_LA, _LT(), ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, addNavigationNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode, ANTLR3_API, ANTLR3_CALLOC, ANTLR3_COMMONTREENODE, ANTLR3_FALSE, ANTLR3_TRUE, antlr3CommonTreeNodeStreamFree(), antlr3IntStreamNew(), antlr3SetCTAPI(), antlr3TreeNodeStreamNew(), antlr3VectorNew(), consume(), ANTLR3_INT_STREAM_struct::consume, ANTLR3_TREE_NODE_STREAM_struct::ctns, DEFAULT_INITIAL_BUFFER_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_TREE_NODE_STREAM_struct::free, ANTLR3_COMMON_TREE_NODE_STREAM_struct::free, ANTLR3_TREE_NODE_STREAM_struct::get, getLookaheadSize(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize, getTreeAdaptor(), ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor, getTreeSource(), ANTLR3_TREE_NODE_STREAM_struct::getTreeSource, hasUniqueNavigationNodes(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes, ANTLR3_INT_STREAM_struct::index, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::isRewriter, ANTLR3_TREE_NODE_STREAM_struct::istream, mark(), ANTLR3_INT_STREAM_struct::mark, ANTLR3_COMMON_TREE_NODE_STREAM_struct::markers, newDownNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode, newUpNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, pop(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop, push(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::push, release(), ANTLR3_INT_STREAM_struct::release, reset(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset, ANTLR3_INT_STREAM_struct::rewind, rewindLast(), ANTLR3_INT_STREAM_struct::rewindLast, rewindMark(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::root, seek(), ANTLR3_INT_STREAM_struct::seek, setUniqueNavigationNodes(), ANTLR3_TREE_NODE_STREAM_struct::setUniqueNavigationNodes, size(), ANTLR3_INT_STREAM_struct::size, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, ANTLR3_INT_STREAM_struct::super, ANTLR3_COMMON_TREE_NODE_STREAM_struct::super, tindex(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream, ANTLR3_COMMON_TREE_struct::token, toString(), ANTLR3_TREE_NODE_STREAM_struct::toString, toStringSS(), ANTLR3_TREE_NODE_STREAM_struct::toStringSS, toStringWork(), ANTLR3_TREE_NODE_STREAM_struct::toStringWork, ANTLR3_INT_STREAM_struct::type, ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint)

References ANTLR3_API, antlr3CommonTreeNodeStreamNew(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::root, and ANTLR3_BASE_TREE_struct::strFactory.

static void antlr3TreeNodeStreamFree (pANTLR3_TREE_NODE_STREAM tns) [static]

References ANTLR3_API, and ANTLR3_FREE.

Referenced by antlr3TreeNodeStreamNew().

ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew ()

References ANTLR3_CALLOC, antlr3TreeNodeStreamFree(), ANTLR3_TREE_NODE_STREAM_struct::free, replaceChildren(), and ANTLR3_TREE_NODE_STREAM_struct::replaceChildren.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void consume (pANTLR3_INT_STREAM is) [static]

Consume the next node from the input stream.

References ANTLR3_TREE_NODE_STREAM_struct::ctns, fillBufferRoot(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void fillBuffer (pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t) [static]

Walk tree with depth-first-search and fill nodes buffer. Don't add in DOWN, UP nodes if the supplied tree is a list (t is isNilNode)

References ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, ANTLR3_VECTOR_struct::add, ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode, ANTLR3_FALSE, ANTLR3_TOKEN_DOWN, ANTLR3_TOKEN_UP, ANTLR3_BASE_TREE_ADAPTOR_struct::getChild, ANTLR3_BASE_TREE_struct::getChildCount, ANTLR3_BASE_TREE_ADAPTOR_struct::isNilNode, nilNode(), and ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes.

Referenced by fillBufferRoot().

static void fillBufferRoot (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

Walk and fill the tree node buffer from the root tree.

References fillBuffer(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::root.

Referenced by _LT(), consume(), get(), mark(), and size().

static pANTLR3_BASE_TREE get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) [static]

References ANTLR3_TREE_NODE_STREAM_struct::ctns, fillBufferRoot(), ANTLR3_VECTOR_struct::get, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::p.

static ANTLR3_UINT32 getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

References ANTLR3_COMMON_TREE_NODE_STREAM_struct::head, ANTLR3_COMMON_TREE_NODE_STREAM_struct::lookAheadLength, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::tail.

Referenced by antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_BASE_TREE_ADAPTOR getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns) [static]

References ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, and ANTLR3_TREE_NODE_STREAM_struct::ctns.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_BASE_TREE getTreeSource (pANTLR3_TREE_NODE_STREAM tns) [static]

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

References ANTLR3_TREE_NODE_STREAM_struct::ctns, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::root.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static ANTLR3_BOOLEAN hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

References ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_BASE_TREE LB (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) [static]

References ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_VECTOR_struct::get, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::p.

Referenced by _LT().

static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is) [static]

Mark the state of the input stream so that we can come back to it after a syntactic predicate and so on.

References ANTLR3_TREE_NODE_STREAM_struct::ctns, fillBufferRoot(), ANTLR3_INT_STREAM_struct::index, ANTLR3_TREE_NODE_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::lastMarker, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, ANTLR3_INT_STREAM_struct::super, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream.

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

static pANTLR3_BASE_TREE newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

References ANTLR3_TEXT_CHARP, ANTLR3_TOKEN_DOWN, antlr3CommonTokenNew(), antlr3CommonTreeNewFromToken(), ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_COMMON_TOKEN_struct::chars, ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_BASE_TREE newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

References ANTLR3_TEXT_CHARP, ANTLR3_TOKEN_UP, antlr3CommonTokenNew(), antlr3CommonTreeNewFromToken(), ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_COMMON_TOKEN_struct::chars, ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static ANTLR3_INT32 pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

References ANTLR3_UINT32_CAST, ANTLR3_TREE_NODE_STREAM_struct::istream, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_STACK_struct::pop, ANTLR3_INT_STREAM_struct::seek, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index) [static]

References ANTLR3_FUNC_PTR, ANTLR3_TREE_NODE_STREAM_struct::istream, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, ANTLR3_STACK_struct::push, ANTLR3_INT_STREAM_struct::seek, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t) [static]

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 monkey-ing with the underlying tree. Also, it might be able to modify the node stream to avoid re-streaming 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.

References ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor, ANTLR3_BASE_TREE_ADAPTOR_struct::replaceChildren, and ANTLR3_BASE_TREE_ADAPTOR_struct::super.

Referenced by antlr3TreeNodeStreamNew().

static void reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns) [static]

Reset the input stream to the start of the input nodes.

References ANTLR3_TRUE, antlr3StackNew(), ANTLR3_STACK_struct::free, INITIAL_CALL_STACK_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::isRewriter, ANTLR3_TREE_NODE_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::lastMarker, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void rewindLast (pANTLR3_INT_STREAM is) [static]

References ANTLR3_INT_STREAM_struct::lastMarker, and ANTLR3_INT_STREAM_struct::seek.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) [static]

Rewind the current state of the tree walk to the state it was in when mark() was called and it returned marker. Also, wipe out the lookahead which will force reloading a few nodes but it is better than making a copy of the lookahead buffer upon mark().

References ANTLR3_INT_STREAM_struct::seek.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) [static]

consume() ahead until we hit index. Can't just jump ahead--must spit out the navigation nodes.

References ANTLR3_UINT32_CAST, ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes) [static]

References ANTLR3_TREE_NODE_STREAM_struct::ctns, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is) [static]

Expensive to compute the size of the whole tree while parsing. This method only returns how much input has been seen so far. So after parsing it returns true size.

References ANTLR3_TREE_NODE_STREAM_struct::ctns, fillBufferRoot(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, ANTLR3_VECTOR_struct::size, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr38BitReuse(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3StringStreamNew(), displayRecognitionError(), newPtr8(), newPtrUTF16_8(), and newPtrUTF16_UTF16().

static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is) [static]

References ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_STRING toString (pANTLR3_TREE_NODE_STREAM tns) [static]

Print out the entire tree including DOWN/UP nodes. Uses a recursive walk. Mostly useful for testing as it yields the token types not text.

References ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_COMMON_TREE_NODE_STREAM_struct::root, and ANTLR3_TREE_NODE_STREAM_struct::toStringSS.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static pANTLR3_STRING toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop) [static]

References ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_STRING_FACTORY_struct::newRaw, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, and ANTLR3_TREE_NODE_STREAM_struct::toStringWork.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

static void toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf) [static]

References ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_TOKEN_DOWN, ANTLR3_TOKEN_UP, ANTLR3_STRING_struct::appendS, ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_BASE_TREE_struct::getChild, ANTLR3_BASE_TREE_struct::getChildCount, ANTLR3_BASE_TREE_struct::getType, ANTLR3_BASE_TREE_struct::isNilNode, ANTLR3_STRING_FACTORY_struct::newRaw, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, ANTLR3_BASE_TREE_struct::toString, and ANTLR3_TREE_NODE_STREAM_struct::toStringWork.

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.

Referenced By

antlr3-addNavigationNode(3), antlr3CommonTreeNodeStreamFree(3), antlr3-consume(3), antlr3-fillBuffer(3), antlr3-fillBufferRoot(3), antlr3-get(3), antlr3-getLookaheadSize(3), antlr3-getTreeAdaptor(3), antlr3-getTreeSource(3), antlr3-hasUniqueNavigationNodes(3), antlr3-_LA(3), antlr3-LB(3), antlr3-_LT(3), antlr3-mark(3), antlr3-newDownNode(3), antlr3-newUpNode(3), antlr3-pop(3), antlr3-push(3), antlr3-release(3), antlr3-reset(3), antlr3-rewindLast(3), antlr3-rewindMark(3), antlr3-seek(3), antlr3-setUniqueNavigationNodes(3), antlr3-size(3), antlr3-tindex(3), antlr3-toStringSS(3), antlr3-toStringWork(3) and antlr3TreeNodeStreamFree(3) are aliases of antlr3commontreenodestream.c(3).

Tue Oct 4 2016 Version 3.3.1 ANTLR3C