ANTLR3_COMMON_...E_STREAM_struct(3)
π¦ ANTLR3_COMMON_TREE_NODE_STREAM_struct π¦
from the ANTLR3C manual, section 3 β bestie, we're doing struct internals today and honestly? it's giving β¨backstage tourβ¨
β¨ NAME β¨
ANTLR3_COMMON_TREE_NODE_STREAM_struct β that's the whole name, that's it, that's the girl π
πΈ SYNOPSIS πΈ
okay so first things first, you gotta pull in the header, no cap:
#include <antlr3commontreenodestream.h>
π Data Fields π
bestie. there are a lot of fields here. like, a lot a lot. we're going through every single one, don't panic, I got you π«Ά
ANTLR3_MARKER absoluteNodeIndexβ so like... which node did we just consume? that one. this tracks it πpANTLR3_BASE_TREE_ADAPTOR adaptorβ a pointer to the tree adaptor interface, aka the thing that manipulates and builds the tree π³void(* addLookahead )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, pANTLR3_BASE_TREE node)β a function pointer field. the page gives us the signature and literally nothing else, so I'm not gonna make stuff up πvoid(* addNavigationNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 ttype)β another function pointer, another mysterious no-blurb moment π signature's all we gotANTLR3_INT32 currentChildIndexβ which child are we currently visiting? this one knows πpANTLR3_BASE_TREE currentNodeβ which node are we currently visiting? same energy, different field β¨ANTLR3_COMMON_TREE DOWNβ a dummy tree node that says "we're descending into a child tree" π¦ANTLR3_COMMON_TREE EOF_NODEβ a dummy tree node that marks the termination point of the tree. it's giving end of the line πvoid(* fill )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 k)β function pointer, no description in the source, moving on π§void(* free )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, again with zero blurb. iconic behavior honestly πANTLR3_UINT32(* getLookaheadSize )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description given πpANTLR3_BASE_TREE(* handleRootnode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, signature only, no notes πANTLR3_BOOLEAN(* hasNext )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, and the page is staying silent about it π€ANTLR3_BOOLEAN(* hasUniqueNavigationNodes )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description here either πΈANTLR3_UINT32 headβlookAhead[head]is the first symbol of lookahead,LT(1). periodt πANTLR3_COMMON_TREE INVALID_NODEβ a dummy node that gets returned if we need to signal an invalid node for any reason. the "something went wrong" girlie πANTLR3_BOOLEAN isRewriterβ tells you whether this node stream was derived from a prior node stream β like, for a rewriting tree parser for instance πpANTLR3_BASE_TREE * lookAheadβ the buffer tree node stream, there for use withLT(i)β¨ANTLR3_UINT32 lookAheadLengthβ how many elements are available in the lookahead buffer at any given moment π’pANTLR3_VECTOR markersβ calls tomark()can be nested, so we gotta keep a whole stack of them. stack of markers, lowkey iconic πpANTLR3_BASE_TREE(* newDownNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no blurb, we move π§pANTLR3_BASE_TREE(* newUpNode )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, again no description πpANTLR3_BASE_TREE(* next )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, signature only πpANTLR3_VECTOR nodesβ the complete mapping from stream index to tree node. the whole map, no cap πΊοΈpANTLR3_STACK nodeStackβ as we walk down the nodes we have to track parent nodes, so we know where to go back to after walking the last child of a node π«ΆANTLR3_INT32 pβ the current index into thenodesvector, for the tree we're currently parsing and possibly rewriting πANTLR3_INT32(* pop )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description given πΈpANTLR3_BASE_TREE previousNodeβ which node did we last visit? the one before this one, bestie πvoid(* push )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 index)β function pointer, page says nothing else about it π€void(* reset )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no blurb πpANTLR3_BASE_TREE rootβ which tree are we navigating? that tree. the main character of the whole operation π³β¨pANTLR3_STRING_FACTORY stringFactoryβ a string factory for anything that wants to make strings β like a tree representation, or some copy of the text, etc. etc. πvoid * superβ any interface that implements this interface (aka is a super structure containing this structure) can stash a pointer to itself right here in thesuperpointer. and just so you know: the common tree node stream does not use it πANTLR3_UINT32 tailβ new lookahead goes in atlookahead[tail]π¦pANTLR3_TREE_NODE_STREAM tnstreamβ a pointer to the tree node stream interface πANTLR3_BOOLEAN uniqueNavigationNodesβ if this is set toANTLR3_TRUE, then the navigation nodesUPandDOWNget duplicated rather than reused inside the tree. copy, don't reuse, periodt πANTLR3_COMMON_TREE UPβ a dummy tree node that says "we're descending up to a parent tree" β¬οΈpANTLR3_BASE_TREE(* visitChild )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 child)β function pointer, no description provided πvoid(* walkBackToMostRecentNodeWithUnvisitedChildren )(struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, signature only, no notes π
β οΈ heads up bestie β this is only part 1 of the page. more is coming, don't go anywhere π«Ά
β¨ Field Documentation β¨
Okay bestie, here's the full tea on every single field in this struct. No skips. π
ANTLR3_MARKER ANTLR3_COMMON_TREE_NODE_STREAM_struct::absoluteNodeIndexβ bestie, this is literally the node index we just consumed. It'si=0..n-1fornnode trees.IntStream.nextis hence1 + this value. Size will be same. πpANTLR3_BASE_TREE_ADAPTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptorβ a pointer to the tree adaptor interface that manipulates/builds the tree. π³- Referenced by
antlr3CommonTreeNodeStreamFree(),antlr3CommonTreeNodeStreamNew(),antlr3CommonTreeNodeStreamNewStream(),fillBuffer(), andgetTreeAdaptor().
- Referenced by
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::addLookahead) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, pANTLR3_BASE_TREE node)β a function pointer, no extra deets in the source. π€·ββοΈvoid(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 ttype)β function pointer, no description, but it's referenced by some real ones. β¨- Referenced by
antlr3CommonTreeNodeStreamNew(),antlr3CommonTreeNodeStreamNewStream(), andfillBuffer().
- Referenced by
ANTLR3_INT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::currentChildIndexβ which child are we currently visiting? If-1we have not visited this node yet; nextconsume()request will setcurrentIndexto0. π§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(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
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(), andgetMissingSymbol().
- Referenced by
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::fill) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 k)β function pointer, no description. πvoid(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::free) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description but it's referenced. ποΈ- Referenced by
antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
ANTLR3_UINT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. π- Referenced by
antlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::handleRootnode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. π±ANTLR3_BOOLEAN(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasNext) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. βANTLR3_BOOLEAN(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. β¨- Referenced by
addNavigationNode(),antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::headβlookAhead[head]is the first symbol of lookahead,LT(1). π- Referenced by
getLookaheadSize().
- Referenced by
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(), andLB().
- Referenced by
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 toANTLR3_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(), andreset().
- Referenced by
pANTLR3_BASE_TREE* ANTLR3_COMMON_TREE_NODE_STREAM_struct::lookAheadβ buffer tree node stream for use withLT(i). This list grows to fit new lookahead depths, butconsume()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().
- Referenced by
pANTLR3_VECTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::markersβ calls tomark()may be nested so we have to track a stack of them. The marker is an index into this stack. Index0is the first marker. This is aList<TreeWalkState>π- Referenced by
antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. β¬οΈ- Referenced by
addNavigationNode(),antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. β¬οΈ- Referenced by
addNavigationNode(),antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::next) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. β‘οΈpANTLR3_VECTOR ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodesβ the complete mapping from stream index to tree node. This buffer includes pointers toDOWN,UP, andEOFnodes. It is built upon ctor invocation. The elements are typeObjectas 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 theif p==-1testing 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(), andsize().
- Referenced by
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(), andreset().
- Referenced by
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(), andtindex().
- Referenced by
ANTLR3_INT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. π- Referenced by
antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::previousNodeβ which node did we last visit? Used forLT(-1)πvoid(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::push) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_INT32 index)β function pointer, no description. π₯- Referenced by
antlr3CommonTreeNodeStreamNew(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. π- Referenced by
antlr3CommonTreeNodeStreamNew(),antlr3CommonTreeNodeStreamNewStream(), andsetTreeNodeStream().
- Referenced by
pANTLR3_BASE_TREE ANTLR3_COMMON_TREE_NODE_STREAM_struct::rootβ which tree are we navigating ? π³- Referenced by
antlr3CommonTreeNodeStreamNewStream(),antlr3CommonTreeNodeStreamNewTree(),fillBufferRoot(),getTreeSource(), andtoString().
- Referenced by
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(), andtoStringWork().
- Referenced by
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(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
ANTLR3_UINT32 ANTLR3_COMMON_TREE_NODE_STREAM_struct::tailβ add new lookahead atlookahead[tail].tailwraps around at the end of the lookahead buffer sotailcould be less thanhead. π- Referenced by
getLookaheadSize().
- Referenced by
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(),mark(),match(),matchAny(),memoize(),pop(),push(),recover(),recoverFromMismatchedElement(),recoverFromMismatchedSet(),recoverFromMismatchedToken(),reset(), andsynpred().
- Referenced by
ANTLR3_BOOLEAN ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodesβ if set toANTLR3_TRUEthen the navigation nodesUP,DOWNare duplicated rather than reused within the tree. π- Referenced by
antlr3CommonTreeNodeStreamNew(),antlr3CommonTreeNodeStreamNewStream(),hasUniqueNavigationNodes(), andsetUniqueNavigationNodes().
- Referenced by
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(), andantlr3CommonTreeNodeStreamNewStream().
- Referenced by
pANTLR3_BASE_TREE(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::visitChild) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns, ANTLR3_UINT32 child)β function pointer, no description. πΆvoid(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::walkBackToMostRecentNodeWithUnvisitedChildren) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns)β function pointer, no description. πΆββοΈ
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code. π
Version 3.3.1, Tue Jul 29 2025 β that's the footer, bestie! π Stay iconic! β¨
π¦ where this page comes from
- fedora 43: antlr3-C-devel 1:3.4-3.5.3.14.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms