src/antlr3treeparser.c(3)

πŸ“¦ version 3.4, in fedora 43

🌸 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 got DOWN/UP nodes 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_EXCEPTION
  • ANTLR3_MISMATCHED_TREE_NODE_NAME
  • antlr3RecognitionExceptionNew()
  • ANTLR3_RECOGNIZER_SHARED_STATE_struct::exception
  • ANTLR3_EXCEPTION_struct::name
  • ANTLR3_BASE_RECOGNIZER_struct::state
  • ANTLR3_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_PARSER
  • ANTLR3_TYPE_TREE_PARSER
  • antlr3BaseRecognizerNew()
  • antlr3MTNExceptionNew()
  • ANTLR3_BASE_RECOGNIZER_struct::exConstruct
  • ANTLR3_TREE_PARSER_struct::free
  • freeParser()
  • ANTLR3_BASE_RECOGNIZER_struct::getCurrentInputSymbol
  • getCurrentInputSymbol()
  • ANTLR3_BASE_RECOGNIZER_struct::getMissingSymbol
  • getMissingSymbol()
  • ANTLR3_TREE_PARSER_struct::getTreeNodeStream
  • getTreeNodeStream()
  • ANTLR3_BASE_RECOGNIZER_struct::mismatch
  • mismatch()
  • ANTLR3_TREE_PARSER_struct::rec
  • ANTLR3_TREE_PARSER_struct::setTreeNodeStream
  • setTreeNodeStream()
  • ANTLR3_BASE_RECOGNIZER_struct::super
  • ANTLR3_BASE_RECOGNIZER_struct::type

πŸ’œ void freeParser (pANTLR3_TREE_PARSER parser) [static]

References

  • ANTLR3_RECOGNIZER_SHARED_STATE_struct::following
  • ANTLR3_BASE_RECOGNIZER_struct::free
  • ANTLR3_STACK_struct::free
  • ANTLR3_TREE_PARSER_struct::rec
  • ANTLR3_BASE_RECOGNIZER_struct::state

πŸ’œ void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) [static]

References

  • ANTLR3_TREE_NODE_STREAM_struct::_LT
  • ANTLR3_TREE_NODE_STREAM_struct::ctns
  • ANTLR3_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::_LT
  • ANTLR3_STRING_struct::append8
  • ANTLR3_COMMON_TREE_struct::baseTree
  • ANTLR3_TREE_NODE_STREAM_struct::ctns
  • ANTLR3_BASE_TREE_struct::dupNode
  • ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE
  • ANTLR3_COMMON_TOKEN_struct::getText
  • ANTLR3_BASE_TREE_struct::getToken
  • ANTLR3_COMMON_TOKEN_struct::setText8
  • ANTLR3_BASE_RECOGNIZER_struct::state
  • ANTLR3_BASE_TREE_struct::super
  • ANTLR3_INT_STREAM_struct::super
  • ANTLR3_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::exConstruct
  • ANTLR3_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::ctnstream
  • ANTLR3_TREE_PARSER_struct::rec
  • ANTLR3_BASE_RECOGNIZER_struct::reset
  • ANTLR3_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