ANTLR3_TREE_NODE_STREAM_struct(3)
π ANTLR3_TREE_NODE_STREAM_struct(3) π
okay bestie, sit down, hydrate, because we're about to get into ANTLR3C's tree node stream struct and honestly? it's giving interface royalty. this is the ANTLR3_TREE_NODE_STREAM_struct page, from the ANTLR3C manual, and yes we're doing the whole thing, no skimming, no skipping, periodt. β¨
πΈ NAME πΈ
ANTLR3_TREE_NODE_STREAM_struct β the struct that says "hi, I'm a stream, but of tree nodes" π¦
π SYNOPSIS π
#include <antlr3commontreenodestream.h>
β¨ Data Fields β¨
pANTLR3_BASE_TREE(* _LT )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_INT32 k)β get me the tree node at current input pointer + i ahead, where i=1 means the next node, iykyk.pANTLR3_COMMON_TREE_NODE_STREAM ctnsβ literally any interface that implements this interface (aka it's a super structure containing this structure) can stash a pointer to itself right here in the super pointer. and fun fact: the tree node stream does not use it.void(* free )(struct ANTLR3_TREE_NODE_STREAM_struct *tns)β release up any and all space that the interface allocated, including space for this very structure. bye bye memory π«ΆpANTLR3_BASE_TREE(* get )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_INT32 i)β get a tree node at an absolute index i;0..n-1.pANTLR3_BASE_TREE_ADAPTOR(* getTreeAdaptor )(struct ANTLR3_TREE_NODE_STREAM_struct *tns)β which adaptor can tell me how to interpret/navigate nodes and trees? this one.pANTLR3_BASE_TREE(* getTreeSource )(struct ANTLR3_TREE_NODE_STREAM_struct *tns)β where is this stream pulling nodes from?pANTLR3_INT_STREAM istreamβ all input streams implement theANTLR3_INT_STREAMinterface...void(* replaceChildren )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t)β replace from start to stop child index of parent witht, which might be a list.void(* setUniqueNavigationNodes )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_BOOLEAN uniqueNavigationNodes)β as we flatten the tree, we use UP, DOWN nodes to represent the tree structure.pANTLR3_STRING(* toString )(struct ANTLR3_TREE_NODE_STREAM_struct *tns)β (no description given, it's just vibing there π)pANTLR3_STRING(* toStringSS )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop)β return the text of all nodes from start to stop, inclusive.void(* toStringWork )(struct ANTLR3_TREE_NODE_STREAM_struct *tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf)β return the text of all nodes from start to stop, inclusive, into the supplied buffer.
π§ Field Documentation π§
π pANTLR3_BASE_TREE(* ANTLR3_TREE_NODE_STREAM_struct::_LT) (struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_INT32 k)
Get tree node at current input pointer + i ahead where i=1 is next node.
i<0 indicates nodes in the past. So LT(-1) is the previous node, but implementations are not required to provide results for k < -1. 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 (beyond the start of the list).
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. :)
Referenced by _LA(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3RecognitionExceptionNew(), getCurrentInputSymbol(), and getMissingSymbol().
π pANTLR3_COMMON_TREE_NODE_STREAM ANTLR3_TREE_NODE_STREAM_struct::ctns
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 tree node stream. This will point to an implementation of ANTLR3_COMMON_TREE_NODE_STREAM in this case.
Referenced by _LT(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), consume(), get(), getCurrentInputSymbol(), getMissingSymbol(), getTreeAdaptor(), getTreeSource(), LB(), mark(), seek(), setUniqueNavigationNodes(), size(), tindex(), toString(), toStringSS(), and toStringWork().
π void(* ANTLR3_TREE_NODE_STREAM_struct::free) (struct ANTLR3_TREE_NODE_STREAM_struct *tns)
Release up any and all space the the interface allocate, including for this structure.
Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and antlr3TreeNodeStreamNew().
π pANTLR3_BASE_TREE(* ANTLR3_TREE_NODE_STREAM_struct::get) (struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_INT32 i)
Get a tree node at an absolute index i; 0..n-1. If you don't want to buffer up nodes, then this method makes no sense for you. harsh but true bestie π
Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
π pANTLR3_BASE_TREE_ADAPTOR(* ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor) (struct ANTLR3_TREE_NODE_STREAM_struct *tns)
What adaptor can tell me how to interpret/navigate nodes and trees. E.g., get text of a node.
Referenced by antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and replaceChildren().
π pANTLR3_BASE_TREE(* ANTLR3_TREE_NODE_STREAM_struct::getTreeSource) (struct ANTLR3_TREE_NODE_STREAM_struct *tns)
Where is this stream pulling nodes from? This is not the name, but the object that provides node objects.
Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
π pANTLR3_INT_STREAM ANTLR3_TREE_NODE_STREAM_struct::istream
All input streams implement the ANTLR3_INT_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().
π void(* ANTLR3_TREE_NODE_STREAM_struct::replaceChildren) (struct ANTLR3_TREE_NODE_STREAM_struct *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. 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 monkeying with the underlying tree. Also, it might be able to modify the node stream to avoid restreaming 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. (yes this is a "do nothing" branch, we love a no-op π )
Referenced by antlr3TreeNodeStreamNew().
π void(* ANTLR3_TREE_NODE_STREAM_struct::setUniqueNavigationNodes) (struct ANTLR3_TREE_NODE_STREAM_struct *tns, ANTLR3_BOOLEAN uniqueNavigationNodes)
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory to create unique navigation nodes. Default should be false;
Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
π pANTLR3_STRING(* ANTLR3_TREE_NODE_STREAM_struct::toString) (struct ANTLR3_TREE_NODE_STREAM_struct *tns)
Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
π pANTLR3_STRING(* ANTLR3_TREE_NODE_STREAM_struct::toStringSS) (struct ANTLR3_TREE_NODE_STREAM_struct *tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop)
Return the text of all nodes from start to stop, inclusive. If the stream does not buffer all the nodes then it can still walk recursively from start until stop. You can always return null or "" too, but users should not access $ruleLabel.text in an action of course in that case.
Referenced by antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and toString().
π void(* ANTLR3_TREE_NODE_STREAM_struct::toStringWork) (struct ANTLR3_TREE_NODE_STREAM_struct *tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf)
Return the text of all nodes from start to stop, inclusive, into the supplied buffer. If the stream does not buffer all the nodes then it can still walk recursively from start until stop. You can always return null or "" too, but users should not access $ruleLabel.text in an action of course in that case.
Referenced by antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), toStringSS(), and toStringWork().
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code.
okay that's the whole page, every field, every referenced-by, nothing left behind because we don't do that here π«Ά this was Version 3.3.1, dated Tue Jul 29 2025, straight from the ANTLR3C source code itself. go forth and stream those tree nodes, bestie, you ate πβ¨π
π¦ 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