apistructures(3)

πŸ“¦ version 3.4, in fedora 43

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 via pANTLR3_BASE_RECOGNIZER.
  • ANTLR3_RECOGNIZER_SHARED_STATE β€” Recognizer Shared State Class Definition
  • ANTLR3_BITSET β€” Bitset Class Definition
  • ANTLR3_TOKEN_FACTORY β€” Token Factory Class Definition
  • ANTLR3_COMMON_TOKEN β€” Common Token Class Definition
  • ANTLR3_EXCEPTION β€” Exception Class Definition
  • ANTLR3_HASH_BUCKET β€” Hash Table Bucket Class Definition
  • ANTLR3_HASH_ENTRY β€” Hash Table Entry Class Definition
  • ANTLR3_HASH_ENUM β€” Hash Table Enumerator Class Definition
  • ANTLR3_HASH_TABLE β€” Hash Table Class Definition
  • ANTLR3_LIST β€” List Class Definition
  • ANTLR3_VECTOR_FACTORY β€” Vector Factory Class Definition
  • ANTLR3_VECTOR β€” Vector Class Definition
  • ANTLR3_STACK β€” Stack Class Definition
  • ANTLR3_INPUT_STREAM β€” Input Stream Class Definition
  • ANTLR3_LEX_STATE β€” Lexer State Class Definition
  • ANTLR3_STRING_FACTORY β€” String Factory Class Definition
  • ANTLR3_STRING β€” String Class Definition
  • ANTLR3_TOKEN_SOURCE β€” Token Source Class Definition
  • ANTLR3_TOKEN_STREAM β€” Token Stream Class Definition
  • ANTLR3_COMMON_TOKEN_STREAM β€” Common Token Stream Class Definition
  • ANTLR3_CYCLIC_DFA β€” Cyclic DFA Class Definition
  • ANTLR3_LEXER β€” Lexer Class Definition
  • ANTLR3_PARSER β€” Parser Class Definition
  • ANTLR3_BASE_TREE β€” Base Tree Class Definition
  • ANTLR3_COMMON_TREE β€” Common Tree Class Definition
  • ANTLR3_ARBORETUM β€” Tree Factory Class Definition
  • ANTLR3_PARSE_TREE β€” Parse Tree Class Definition
  • ANTLR3_TREE_NODE_STREAM β€” Tree Node Class Definition
  • ANTLR3_COMMON_TREE_NODE_STREAM β€” Common Tree Node Class Definition
  • ANTLR3_TREE_WALK_STATE β€” Tree Walk State Class Definition
  • ANTLR3_BASE_TREE_ADAPTOR β€” Base Tree Class Definition
  • ANTLR3_COMMON_TREE_ADAPTOR β€” Common Tree Adaptor Class Definition
  • ANTLR3_TREE_PARSER β€” Tree Parser Class Definition
  • ANTLR3_INT_TRIE β€” Trie Class Definition
  • ANTLR3_REWRITE_RULE_ELEMENT_STREAM β€” Token Rewrite Stream Class Definition
  • ANTLR3_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