ANTLR3_EXCEPTION_struct man page

ANTLR3_EXCEPTION_struct — Base structure for an ANTLR3 exception tracker.

Synopsis

#include <antlr3exception.h>

Data Fields

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

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(), 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.

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(), 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..... ' ;-)

Referenced by antlr3ExceptionFree(), antlr3ExceptionNew(), antlr3ExceptionPrint(), antlr3RecognitionExceptionNew(), 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(), 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(), mismatch(), noViableAlt(), recoverFromMismatchedSet(), and recoverFromMismatchedToken().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.

Referenced By

antlr3-c(3), antlr3-charPositionInLine(3), antlr3-decisionNum(3), antlr3-expecting(3), antlr3-expectingSet(3), antlr3-freeEx(3), antlr3-freeMessage(3), antlr3-message(3), antlr3-name(3), antlr3-nextException(3), antlr3-node(3), antlr3-print(3), antlr3-ruleName(3) and antlr3-streamName(3) are aliases of ANTLR3_EXCEPTION_struct(3).

Tue Oct 4 2016 Version 3.3.1 ANTLR3C