ANTLR3_COMMON_...E_STREAM_struct(3)

πŸ“¦ version 3.4, in fedora 43

πŸ¦‹ 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 got
  • ANTLR3_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 with LT(i) ✨
  • ANTLR3_UINT32 lookAheadLength β€” how many elements are available in the lookahead buffer at any given moment πŸ”’
  • pANTLR3_VECTOR markers β€” calls to mark() 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 the nodes vector, 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 the super pointer. and just so you know: the common tree node stream does not use it πŸ™ˆ
  • ANTLR3_UINT32 tail β€” new lookahead goes in at lookahead[tail] πŸ¦‹
  • pANTLR3_TREE_NODE_STREAM tnstream β€” a pointer to the tree node stream interface 🌈
  • ANTLR3_BOOLEAN uniqueNavigationNodes β€” if this is set to ANTLR3_TRUE, then the navigation nodes UP and DOWN get 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's 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 β€” a pointer to the 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) β€” 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(), 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 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) β€” 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(), and antlr3CommonTreeNodeStreamNewStream().
  • ANTLR3_UINT32(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns) β€” function pointer, no description. πŸ‘€
    • Referenced by antlr3CommonTreeNodeStreamNewStream().
  • 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(), and antlr3CommonTreeNodeStreamNewStream().
  • 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) β€” function pointer, no description. ⬇️
    • Referenced by addNavigationNode(), antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
  • 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(), and antlr3CommonTreeNodeStreamNewStream().
  • 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 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) β€” function pointer, no description. 🎈
    • 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) β€” function pointer, no description. πŸ“₯
    • Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
  • void(* ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *ctns) β€” function pointer, no description. πŸ”„
    • 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(), fillBufferRoot(), getTreeSource(), and toString().
  • 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().
  • 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(), 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(), 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) β€” 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