antlr3commontreenodestream.c File Reference


Detailed Description

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

#include <antlr3commontreenodestream.h>

Include dependency graph for antlr3commontreenodestream.c:


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)
static void addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype)
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)
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)
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)
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)
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)
static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index)
static void setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes)
static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is)
static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is)
static pANTLR3_STRING toString (pANTLR3_TREE_NODE_STREAM tns)
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)

Function Documentation

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

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

Here is the caller graph for this function:

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static void antlr3CommonTreeNodeStreamFree ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

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_COMMON_TREE_NODE_STREAM_struct::super, ANTLR3_INT_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().

Here is the call graph for this function:

Here is the caller graph for this function:

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_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_COMMON_TREE_NODE_STREAM_struct::super, ANTLR3_INT_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.

Here is the call graph for this function:

ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree ( pANTLR3_BASE_TREE  tree,
ANTLR3_UINT32  hint 
)

static void antlr3TreeNodeStreamFree ( pANTLR3_TREE_NODE_STREAM  tns  )  [static]

References ANTLR3_FREE.

Referenced by antlr3TreeNodeStreamNew().

Here is the caller graph for this function:

ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew (  ) 

static void consume ( pANTLR3_INT_STREAM  is  )  [static]

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(), getTokens(), getTokensSet(), LB(), tokLT(), toString(), and toStringSS().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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

static ANTLR3_UINT32 getLookaheadSize ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static pANTLR3_BASE_TREE_ADAPTOR getTreeAdaptor ( pANTLR3_TREE_NODE_STREAM  tns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static pANTLR3_BASE_TREE getTreeSource ( pANTLR3_TREE_NODE_STREAM  tns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static ANTLR3_BOOLEAN hasUniqueNavigationNodes ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

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

static ANTLR3_MARKER mark ( pANTLR3_INT_STREAM  is  )  [static]

static pANTLR3_BASE_TREE newDownNode ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static pANTLR3_BASE_TREE newUpNode ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static ANTLR3_INT32 pop ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

static void reset ( pANTLR3_COMMON_TREE_NODE_STREAM  ctns  )  [static]

static void rewindLast ( pANTLR3_INT_STREAM  is  )  [static]

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:

static ANTLR3_UINT32 size ( pANTLR3_INT_STREAM  is  )  [static]

static ANTLR3_MARKER tindex ( pANTLR3_INT_STREAM  is  )  [static]

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

Here is the caller graph for this function:

static pANTLR3_STRING toString ( pANTLR3_TREE_NODE_STREAM  tns  )  [static]

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

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

Here is the caller graph for this function:

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

Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().

Here is the caller graph for this function:


Generated on Mon Nov 29 17:23:36 2010 for ANTLR3C by  doxygen 1.5.5