ANTLR3_EXCEPTION_struct(3)
β¨ ANTLR3_EXCEPTION_struct β¨ β the ANTLR3C manual page, bestie edition π
okay so this is the ANTLR3_EXCEPTION_struct(3) page from the ANTLR3C manual, and we're gonna get you fully caught up, no cap. π¦
πΈ NAME πΈ
ANTLR3_EXCEPTION_struct β the base structure for an ANTLR3 exception tracker. it's giving "foundation of the whole drama," fr fr. π
β¨ SYNOPSIS β¨
#include <antlr3exception.h>
π Data Fields π
okay bestie, here's the whole roster of fields. every single one. don't scroll past, they all matter π
ANTLR3_UCHAR cβ the current character when an error occurred β for lexers.ANTLR3_INT32 charPositionInLineβ character position in the line where the error occurred.void * customβ pointer for you, the programmer, to add anything you like to an exception. it's YOUR little pocket, decorate it however π«ΆANTLR3_UINT32 decisionNumβ decision number for NVE.ANTLR3_UINT32 expectingβ indicates the token we were expecting to see next when the error occurred.pANTLR3_BITSET_LIST expectingSetβ indicates a set of tokens that we were expecting to see one of when the error occurred.void(* freeCustom )(void *custom)β pointer to a routine that is called to free the custom exception structure when the exception is destroyed.void(* freeEx )(struct ANTLR3_EXCEPTION_struct *ex)ANTLR3_BOOLEAN freeMessageβ if set toANTLR3_TRUE, this indicates that the message element of this structure should be freed by callingANTLR3_FREE()when the exception is destroyed.ANTLR3_MARKER indexβ indicates the index of the 'token' we were looking at when the exception occurred.pANTLR3_INT_STREAM inputβ pointer to the input stream that this exception occurred in.ANTLR3_UINT32 lineβ track the line at which the error occurred in case this is generated from a lexer.void * messageβ the printable message that goes with this exception, in your preferred encoding format.void * nameβ the string name of the exception.struct ANTLR3_EXCEPTION_struct * nextExceptionβ pointer to the next exception in the chain (if any).void * nodeβ if this is a tree parser exception then the node is set to point to the node that caused the issue.void(* print )(struct ANTLR3_EXCEPTION_struct *ex)void * ruleNameβ rule name for failed predicate exception.ANTLR3_UINT32 stateβ state for NVE.pANTLR3_STRING streamNameβ name of the file/input source for reporting.void * tokenβ indicates what the current token/tree was when the error occurred.ANTLR3_UINT32 typeβ set to one of the exception type defines.
π Detailed Description π
base structure for an ANTLR3 exception tracker. that's the whole vibe. it's the blueprint everything else builds on, and honestly? iconic. β¨
π Field Documentation π
π· ANTLR3_UCHAR ANTLR3_EXCEPTION_struct::c π·
the current character when an error occurred β for lexers. π
referenced by antlr3RecognitionExceptionNew(), and displayRecognitionError().
π· ANTLR3_INT32 ANTLR3_EXCEPTION_struct::charPositionInLine π·
character position in the line where the error occurred.
referenced by antlr3RecognitionExceptionNew(), displayRecognitionError(), displayRecognitionError(), and recognitionException().
π· void* ANTLR3_EXCEPTION_struct::custom π·
pointer for you, the programmer, to add anything you like to an exception.
referenced by antlr3ExceptionFree().
π· ANTLR3_UINT32 ANTLR3_EXCEPTION_struct::decisionNum π·
decision number for NVE.
referenced by noViableAlt().
π· ANTLR3_UINT32 ANTLR3_EXCEPTION_struct::expecting π·
indicates the token we were expecting to see next when the error occurred.
referenced by displayRecognitionError(), mismatch(), mismatchIsUnwantedToken(), and recoverFromMismatchedToken().
π· pANTLR3_BITSET_LIST ANTLR3_EXCEPTION_struct::expectingSet π·
indicates a set of tokens that we were expecting to see one of when the error occurred. it is a following bitset list, so you can use load it and use ->toIntList() on it to generate an array of integer tokens that it represents. lowkey handy. π§
referenced by displayRecognitionError().
π· void(* ANTLR3_EXCEPTION_struct::freeCustom) (void *custom) π·
pointer to a routine that is called to free the custom exception structure when the exception is destroyed. set to NULL if nothing should be done.
referenced by antlr3ExceptionFree().
π· void(* ANTLR3_EXCEPTION_struct::freeEx) (struct ANTLR3_EXCEPTION_struct *ex) π·
referenced by antlr3ExceptionNew(), freeBR(), and reset().
π· ANTLR3_BOOLEAN ANTLR3_EXCEPTION_struct::freeMessage π·
if set to ANTLR3_TRUE, this indicates that the message element of this structure should be freed by calling ANTLR3_FREE() when the exception is destroyed.
referenced by antlr3ExceptionFree(), and antlr3ExceptionNew().
π· ANTLR3_MARKER ANTLR3_EXCEPTION_struct::index π·
indicates the index of the 'token' we were looking at when the exception occurred.
referenced by antlr3RecognitionExceptionNew(), displayRecognitionError(), and recognitionException().
π· pANTLR3_INT_STREAM ANTLR3_EXCEPTION_struct::input π·
pointer to the input stream that this exception occurred in.
referenced by antlr3RecognitionExceptionNew().
π· ANTLR3_UINT32 ANTLR3_EXCEPTION_struct::line π·
track the line at which the error occurred in case this is generated from a lexer. we need to track this since the unexpected char doesn't carry the line info.
referenced by antlr3RecognitionExceptionNew(), displayRecognitionError(), displayRecognitionError(), and recognitionException().
π· void* ANTLR3_EXCEPTION_struct::message π·
the printable message that goes with this exception, in your preferred encoding format. ANTLR just uses ASCII by default but you can ignore these messages or convert them to another format or whatever of course. they are really internal messages that you then decide how to print out in a form that the users of your product will understand, as they are unlikely to know what to do with "Recognition exception at: [[TOK_GERUND..... " ;-) π not the TOK_GERUND jumpscare
referenced by antlr3ExceptionFree(), antlr3ExceptionNew(), antlr3ExceptionPrint(), antlr3RecognitionExceptionNew(), displayRecognitionError(), displayRecognitionError(), noViableAlt(), and recoverFromMismatchedToken().
π· void* ANTLR3_EXCEPTION_struct::name π·
the string name of the exception.
referenced by antlr3ExceptionNew(), antlr3MTExceptionNew(), antlr3MTNExceptionNew(), displayRecognitionError(), mismatch(), and recognitionException().
π· struct ANTLR3_EXCEPTION_struct* ANTLR3_EXCEPTION_struct::nextException π·
pointer to the next exception in the chain (if any).
referenced by antlr3ExceptionFree(), antlr3ExceptionPrint(), and antlr3RecognitionExceptionNew().
π· void* ANTLR3_EXCEPTION_struct::node π·
if this is a tree parser exception then the node is set to point to the node that caused the issue.
π· void(* ANTLR3_EXCEPTION_struct::print) (struct ANTLR3_EXCEPTION_struct *ex) π·
referenced by antlr3ExceptionNew().
π· void* ANTLR3_EXCEPTION_struct::ruleName π·
rule name for failed predicate exception.
π· ANTLR3_UINT32 ANTLR3_EXCEPTION_struct::state π·
state for NVE.
referenced by noViableAlt().
π· pANTLR3_STRING ANTLR3_EXCEPTION_struct::streamName π·
name of the file/input source for reporting. note that this may be NULL!!
referenced by antlr3RecognitionExceptionNew(), displayRecognitionError(), and displayRecognitionError().
π· void* ANTLR3_EXCEPTION_struct::token π·
indicates what the current token/tree was when the error occurred. since not all input streams will be able to retrieve the nth token, we track it here instead. this is for parsers, and even tree parsers may set this.
referenced by antlr3RecognitionExceptionNew(), displayRecognitionError(), recoverFromMismatchedSet(), and recoverFromMismatchedToken().
π· ANTLR3_UINT32 ANTLR3_EXCEPTION_struct::type π·
set to one of the exception type defines:
ANTLR3_RECOGNITION_EXCEPTIONANTLR3_MISMATCHED_TOKEN_EXCEPTIONANTLR3_NO_VIABLE_ALT_EXCEPTIONANTLR3_MISMATCHED_SET_EXCEPTIONANTLR3_EARLY_EXIT_EXCEPTIONANTLR3_FAILED_PREDICATE_EXCEPTIONANTLR3_EARLY_EXIT_EXCEPTION
referenced by antlr3ExceptionNew(), antlr3ExceptionPrint(), antlr3MTExceptionNew(), antlr3MTNExceptionNew(), displayRecognitionError(), displayRecognitionError(), mismatch(), noViableAlt(), recoverFromMismatchedSet(), and recoverFromMismatchedToken().
π Author π
generated automatically by Doxygen for ANTLR3C from the source code. (yes bestie, the robots wrote it, we're just here to make it cute π )
that's a wrap! π stay slaying those exceptions, and remember: version 3.3.1, dated Tue Jul 29 2025 00:00:00, and this whole page lives under the ANTLR3C manual in section 3 of the manual pages. periodt. β¨ππ¦
π¦ 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