apistructures(3)
okay so bestie, you opened apistructures(3) and it's giving β¨ANTLR3Cβ¨ β this is the page where all the C structs and typedefs live, the ones that are basically objects but make it C. let's get into it π
π NAME π
apistructures β API Typedefs and Structs
- These structures (and the typedefs that you use to reference them and their pointers) are the C equivalent of objects.
π¦ SYNOPSIS π¦
πΈ Topics
ANTLR3_BASE_RECOGNIZERβ Base Recognizer Class Definition. This is the definition of the base recognizer interface, instantiations of which are referred to viapANTLR3_BASE_RECOGNIZER.ANTLR3_RECOGNIZER_SHARED_STATEβ Recognizer Shared State Class DefinitionANTLR3_BITSETβ Bitset Class DefinitionANTLR3_TOKEN_FACTORYβ Token Factory Class DefinitionANTLR3_COMMON_TOKENβ Common Token Class DefinitionANTLR3_EXCEPTIONβ Exception Class DefinitionANTLR3_HASH_BUCKETβ Hash Table Bucket Class DefinitionANTLR3_HASH_ENTRYβ Hash Table Entry Class DefinitionANTLR3_HASH_ENUMβ Hash Table Enumerator Class DefinitionANTLR3_HASH_TABLEβ Hash Table Class DefinitionANTLR3_LISTβ List Class DefinitionANTLR3_VECTOR_FACTORYβ Vector Factory Class DefinitionANTLR3_VECTORβ Vector Class DefinitionANTLR3_STACKβ Stack Class DefinitionANTLR3_INPUT_STREAMβ Input Stream Class DefinitionANTLR3_LEX_STATEβ Lexer State Class DefinitionANTLR3_STRING_FACTORYβ String Factory Class DefinitionANTLR3_STRINGβ String Class DefinitionANTLR3_TOKEN_SOURCEβ Token Source Class DefinitionANTLR3_TOKEN_STREAMβ Token Stream Class DefinitionANTLR3_COMMON_TOKEN_STREAMβ Common Token Stream Class DefinitionANTLR3_CYCLIC_DFAβ Cyclic DFA Class DefinitionANTLR3_LEXERβ Lexer Class DefinitionANTLR3_PARSERβ Parser Class DefinitionANTLR3_BASE_TREEβ Base Tree Class DefinitionANTLR3_COMMON_TREEβ Common Tree Class DefinitionANTLR3_ARBORETUMβ Tree Factory Class DefinitionANTLR3_PARSE_TREEβ Parse Tree Class DefinitionANTLR3_TREE_NODE_STREAMβ Tree Node Class DefinitionANTLR3_COMMON_TREE_NODE_STREAMβ Common Tree Node Class DefinitionANTLR3_TREE_WALK_STATEβ Tree Walk State Class DefinitionANTLR3_BASE_TREE_ADAPTORβ Base Tree Class DefinitionANTLR3_COMMON_TREE_ADAPTORβ Common Tree Adaptor Class DefinitionANTLR3_TREE_PARSERβ Tree Parser Class DefinitionANTLR3_INT_TRIEβ Trie Class DefinitionANTLR3_REWRITE_RULE_ELEMENT_STREAMβ Token Rewrite Stream Class DefinitionANTLR3_DEBUG_EVENT_LISTENERβ Debugger Class Definition
π Data Structures
struct ANTLR3_INPUT_STREAM_structβ Master context structure for an ANTLR3 C runtime based input stream.
π«Ά Typedefs
typedef struct ANTLR3_INPUT_STREAM_struct ANTLR3_INPUT_STREAMβ Master context structure for an ANTLR3 C runtime based input stream.
π₯ Detailed Description π₯
So. These structures (and the typedefs that you use to reference them and their pointers) are the C equivalent of objects. no cap π«‘
They correspond (roughly) to the Java runtime system classes and contain all the data elements for a particular interface as well as all the pointers to functions that implement these interfaces. like, the data and the behaviour, living in one struct. iconic behaviour tbh.
There are constructor functions exported from the C runtime, which you use to create a default implementation of one of these 'classes'. You can then override any part of the implementation by installing your own function pointers, before using the interface 'object' you have created. basically: build it, then hot-swap the bits you don't vibe with, then use it. order matters bestie π
For instance, you can override the default error message reporting function by replacing the standard (example) implementation of this function with your own. In your grammar, you would place the following:
@parser::apifuncs
{
// Install custom error message display
//
RECOGNIZER->displayRecognitionError = produceError;
}
The special section @parser::apiFuncs is guaranteed to be generated after the RECONGIZER 'object' has already be created and initialized, so you may install your own implementations of the ANTLR3_BASE_RECOGNIZER interface functions. The error display function is likely to be the only one you are interested in replacing. (yes, that's the one most people actually touch β the rest is giving "I'll get to it later" energy π)
Some typedef structures contain either pointers to 'inherited' objects (usual) or embedded structures/typedefs (unusual). In some cases, the pointers passed around by the paresr or tree parser are actually the pointers to these embedded structures (such as pANTLR3_BASE_TREE), and these embedded 'objects' contain pointers to their encapsulating objects. This is the equivalent of passing interface objects around in object oriented languages. so the pointer you're handed might not be the whole vibe β it might be a nested piece that knows how to get back to its parent. iykyk π
β Typedef Documentation β
π typedef struct ANTLR3_INPUT_STREAM_struct ANTLR3_INPUT_STREAM
Master context structure for an ANTLR3 C runtime based input stream.
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code. (not a human, just Doxygen doing its little thing β¨)
and that's the whole page bestie, every last struct accounted for π
okay so the sign-off: this is Version 3.3.1, dated Tue Jul 29 2025 00:00:00. slay, go forth and build your objects ππ¦πΈ
π¦ 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