ANTLR3_EXCEPTION_struct(3)

πŸ“¦ version 3.4, in fedora 43

✨ 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 to ANTLR3_TRUE, this indicates that the message element of this structure should be freed by calling ANTLR3_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_EXCEPTION
  • ANTLR3_MISMATCHED_TOKEN_EXCEPTION
  • ANTLR3_NO_VIABLE_ALT_EXCEPTION
  • ANTLR3_MISMATCHED_SET_EXCEPTION
  • ANTLR3_EARLY_EXIT_EXCEPTION
  • ANTLR3_FAILED_PREDICATE_EXCEPTION
  • ANTLR3_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