| 1 |
/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.0 */ |
| 2 |
/* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ |
| 3 |
#ifndef _PARSE_EXCEPTION_H |
| 4 |
#define _PARSE_EXCEPTION_H |
| 5 |
#include "JavaCC.h" |
| 6 |
#include "Token.h" |
| 7 |
|
| 8 |
|
| 9 |
namespace Konclude { |
| 10 |
namespace Parser { |
| 11 |
namespace FunctionalJAVACC { |
| 12 |
/** |
| 13 |
* This exception is thrown when parse errors are encountered. |
| 14 |
* You can explicitly create objects of this exception type by |
| 15 |
* calling the method generateParseException in the generated |
| 16 |
* parser. |
| 17 |
* |
| 18 |
* You can modify this class to customize your error reporting |
| 19 |
* mechanisms so long as you retain the fields. |
| 20 |
*/ |
| 21 |
class ParseException { |
| 22 |
public: |
| 23 |
|
| 24 |
/** |
| 25 |
* This constructor is used by the method "generateParseException" |
| 26 |
* in the generated parser. Calling this constructor generates |
| 27 |
* a new object of this type with the fields "currentToken", |
| 28 |
* "expectedTokenSequences", and "tokenImage" set. |
| 29 |
*/ |
| 30 |
ParseException(Token currentTokenVal, |
| 31 |
int** expectedTokenSequencesVal, |
| 32 |
JAVACC_STRING_TYPE* tokenImageVal |
| 33 |
); |
| 34 |
|
| 35 |
/** |
| 36 |
* The following constructors are for use by you for whatever |
| 37 |
* purpose you can think of. Constructing the exception in this |
| 38 |
* manner makes the exception behave in the normal way - i.e., as |
| 39 |
* documented in the class "Throwable". The fields "errorToken", |
| 40 |
* "expectedTokenSequences", and "tokenImage" do not contain |
| 41 |
* relevant information. The JavaCC generated code does not use |
| 42 |
* these constructors. |
| 43 |
*/ |
| 44 |
|
| 45 |
ParseException(); |
| 46 |
|
| 47 |
/** Constructor with message. */ |
| 48 |
ParseException(JAVACC_STRING_TYPE message); |
| 49 |
|
| 50 |
|
| 51 |
/** |
| 52 |
* This is the last token that has been consumed successfully. If |
| 53 |
* this object has been created due to a parse error, the token |
| 54 |
* followng this token will (therefore) be the first error token. |
| 55 |
*/ |
| 56 |
Token currentToken; |
| 57 |
|
| 58 |
/** |
| 59 |
* Each entry in this array is an array of integers. Each array |
| 60 |
* of integers represents a sequence of tokens (by their ordinal |
| 61 |
* values) that is expected at this point of the parse. |
| 62 |
*/ |
| 63 |
int** expectedTokenSequences; |
| 64 |
|
| 65 |
/** |
| 66 |
* This is a reference to the "tokenImage" array of the generated |
| 67 |
* parser within which the parse error occurred. This array is |
| 68 |
* defined in the generated ...Constants class. |
| 69 |
*/ |
| 70 |
JAVACC_STRING_TYPE* tokenImage; |
| 71 |
|
| 72 |
/** |
| 73 |
* It uses "currentToken" and "expectedTokenSequences" to generate a parse |
| 74 |
* error message and returns it. If this object has been created |
| 75 |
* due to a parse error, and you do not catch it (it gets thrown |
| 76 |
* from the parser) the correct error message |
| 77 |
* gets displayed. |
| 78 |
*/ |
| 79 |
private: JAVACC_STRING_TYPE initialise(Token currentToken, |
| 80 |
int** expectedTokenSequences, |
| 81 |
JAVACC_STRING_TYPE* tokenImage); |
| 82 |
|
| 83 |
/** |
| 84 |
* The end of line string for this machine. |
| 85 |
*/ |
| 86 |
#define eol "\n" |
| 87 |
|
| 88 |
/** |
| 89 |
* Used to convert raw characters to their escaped version |
| 90 |
* when these raw version cannot be used as part of an ASCII |
| 91 |
* string literal. |
| 92 |
*/ |
| 93 |
JAVACC_STRING_TYPE add_escapes(JAVACC_STRING_TYPE str); |
| 94 |
|
| 95 |
}; |
| 96 |
|
| 97 |
} |
| 98 |
} |
| 99 |
} |
| 100 |
#endif |
| 101 |
/* JavaCC - OriginalChecksum=9c0f1db15d15cbaaa80670886f32f98a (do not edit this line) */ |