src/antlr3treeparser.c(3)
πΈ NAME πΈ
src/antlr3treeparser.c β bestie, this is the implementation of the tree parser plus all the overrides for the base recognizer. π
β¨ SYNOPSIS β¨
#include <antlr3treeparser.h>
π¦ Functions π¦
ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)β makes a brand new Mismatched Tree Nde Exception and drops it into the recognizer's exception stack. πANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state)β yes, it's the one that allocates the tree parser memory (more on that below, keep reading π«Ά).static void freeParser (pANTLR3_TREE_PARSER parser)β the little cleanup gremlin.static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream)β grabs the current input symbol.static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow)β the "oops we're missing a symbol" handler.static pANTLR3_COMMON_TREE_NODE_STREAM getTreeNodeStream (pANTLR3_TREE_PARSER parser)β returns a pointer to the input stream. that's it, that's the job β¨static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow)β an override for the standard base recognizer mismatch function, because we've gotDOWN/UPnodes chillin' in the stream with no line info, and also we wanna change up the exception type. πstatic void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input)β sets the input stream and resets the parser.
π Detailed Description π
Implementation of the tree parser and overrides for the base recognizer. periodt. β¨
π§ Function Documentation π§
π ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)
Creates a new Mismatched Tree Nde Exception and inserts in the recognizer exception stack. iconic behaviour honestly.
Parameters
recognizerβ Context pointer for this recognizer π«Ά
References
ANTLR3_MISMATCHED_TREE_NODE_EXCEPTIONANTLR3_MISMATCHED_TREE_NODE_NAMEantlr3RecognitionExceptionNew()ANTLR3_RECOGNIZER_SHARED_STATE_struct::exceptionANTLR3_EXCEPTION_struct::nameANTLR3_BASE_RECOGNIZER_struct::stateANTLR3_EXCEPTION_struct::type
Referenced by
antlr3TreeParserNewStream()
π ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state)
Allocate tree parser memory. get you a function that can do both π
References
ANTLR3_TYPE_PARSERANTLR3_TYPE_TREE_PARSERantlr3BaseRecognizerNew()antlr3MTNExceptionNew()ANTLR3_BASE_RECOGNIZER_struct::exConstructANTLR3_TREE_PARSER_struct::freefreeParser()ANTLR3_BASE_RECOGNIZER_struct::getCurrentInputSymbolgetCurrentInputSymbol()ANTLR3_BASE_RECOGNIZER_struct::getMissingSymbolgetMissingSymbol()ANTLR3_TREE_PARSER_struct::getTreeNodeStreamgetTreeNodeStream()ANTLR3_BASE_RECOGNIZER_struct::mismatchmismatch()ANTLR3_TREE_PARSER_struct::recANTLR3_TREE_PARSER_struct::setTreeNodeStreamsetTreeNodeStream()ANTLR3_BASE_RECOGNIZER_struct::superANTLR3_BASE_RECOGNIZER_struct::type
π void freeParser (pANTLR3_TREE_PARSER parser) [static]
References
ANTLR3_RECOGNIZER_SHARED_STATE_struct::followingANTLR3_BASE_RECOGNIZER_struct::freeANTLR3_STACK_struct::freeANTLR3_TREE_PARSER_struct::recANTLR3_BASE_RECOGNIZER_struct::state
π void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) [static]
References
ANTLR3_TREE_NODE_STREAM_struct::_LTANTLR3_TREE_NODE_STREAM_struct::ctnsANTLR3_INT_STREAM_struct::super
π void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) [static]
References
ANTLR3_TREE_NODE_STREAM_struct::_LTANTLR3_STRING_struct::append8ANTLR3_COMMON_TREE_struct::baseTreeANTLR3_TREE_NODE_STREAM_struct::ctnsANTLR3_BASE_TREE_struct::dupNodeANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODEANTLR3_COMMON_TOKEN_struct::getTextANTLR3_BASE_TREE_struct::getTokenANTLR3_COMMON_TOKEN_struct::setText8ANTLR3_BASE_RECOGNIZER_struct::stateANTLR3_BASE_TREE_struct::superANTLR3_INT_STREAM_struct::superANTLR3_RECOGNIZER_SHARED_STATE_struct::tokenNames
π pANTLR3_COMMON_TREE_NODE_STREAM getTreeNodeStream (pANTLR3_TREE_PARSER parser) [static]
Return a pointer to the input stream. simple, clean, no notes π
References
ANTLR3_TREE_PARSER_struct::ctnstream
Referenced by
antlr3TreeParserNewStream()
π void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) [static]
Override for standard base recognizer mismatch function as we have DOWN/UP nodes in the stream that have no line info, plus we want to alter the exception type. lowkey the drama of it all π
References
ANTLR3_BASE_RECOGNIZER_struct::exConstructANTLR3_BASE_RECOGNIZER_struct::recoverFromMismatchedToken
π void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input) [static]
Set the input stream and reset the parser.
References
ANTLR3_TREE_PARSER_struct::ctnstreamANTLR3_TREE_PARSER_struct::recANTLR3_BASE_RECOGNIZER_struct::resetANTLR3_COMMON_TREE_NODE_STREAM_struct::reset
Referenced by
antlr3TreeParserNewStream()
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code. not a human wrote this one bestie, it's giving robot β¨
π okay so that's the whole page!! this is Version 3.3.1, dated Tue Jul 29 2025 00:00:00, from the ANTLR3C manual, section 3, file src/antlr3treeparser.c. slay, go read some more manpages, ily π«ΆπΈ
π¦ 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