ANTLR3_EXCEPTION_struct Struct Reference

#include <antlr3exception.h>

Collaboration diagram for ANTLR3_EXCEPTION_struct:

Collaboration graph
[legend]

Detailed Description

Base structure for an ANTLR3 exception tracker.

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

Field Documentation

The current character when an error occurred - for lexers.

Referenced by antlr3RecognitionExceptionNew(), and displayRecognitionError().

Character position in the line where the error occurred.

Referenced by antlr3RecognitionExceptionNew(), and displayRecognitionError().

Pointer for you, the programmer to add anything you like to an exception.

Referenced by antlr3ExceptionFree().

decision number for NVE

Referenced by noViableAlt().

Indicates the token we were expecting to see next when the error occurred.

Referenced by displayRecognitionError(), mismatch(), mismatchIsUnwantedToken(), and recoverFromMismatchedToken().

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

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

Referenced by antlr3ExceptionNew(), and freeBR().

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

Indicates the index of the 'token' we were looking at when the exception occurred.

Referenced by antlr3RecognitionExceptionNew(), and displayRecognitionError().

Pointer to the input stream that this exception occurred in.

Referenced by antlr3RecognitionExceptionNew().

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

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

Pointer to the next exception in the chain (if any).

Referenced by antlr3ExceptionFree(), antlr3ExceptionPrint(), and antlr3RecognitionExceptionNew().

If this is a tree parser exception then the node is set to point to the node that caused the issue.

Referenced by antlr3ExceptionNew().

Rule name for failed predicate exception.

State for NVE.

Referenced by noViableAlt().

Name of the file/input source for reporting.

Note that this may be NULL!!

Referenced by antlr3RecognitionExceptionNew(), and displayRecognitionError().

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


The documentation for this struct was generated from the following file:

Generated on Mon Nov 29 17:24:04 2010 for ANTLR3C by  doxygen 1.5.5