antlr3-apistructures man page

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.

Modules

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

These structures (and the typedefs that you use to reference them and their pointers) are the C equivalent of objects.

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.

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.

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 ::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.

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.

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.

Info

Tue Oct 4 2016 Version 3.3.1 ANTLR3C