1 /* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.0 */
2 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
3 #ifndef _PARSE_EXCEPTION_H
4 #define _PARSE_EXCEPTION_H
12 * This exception is thrown when parse errors are encountered.
13 * You can explicitly create objects of this exception type by
14 * calling the method generateParseException in the generated
17 * You can modify this class to customize your error reporting
18 * mechanisms so long as you retain the fields.
20 class ParseException {
24 * This constructor is used by the method "generateParseException"
25 * in the generated parser. Calling this constructor generates
26 * a new object of this type with the fields "currentToken",
27 * "expectedTokenSequences", and "tokenImage" set.
29 ParseException(Token currentTokenVal,
30 int** expectedTokenSequencesVal,
31 JAVACC_STRING_TYPE* tokenImageVal
35 * The following constructors are for use by you for whatever
36 * purpose you can think of. Constructing the exception in this
37 * manner makes the exception behave in the normal way - i.e., as
38 * documented in the class "Throwable". The fields "errorToken",
39 * "expectedTokenSequences", and "tokenImage" do not contain
40 * relevant information. The JavaCC generated code does not use
46 /** Constructor with message. */
47 ParseException(JAVACC_STRING_TYPE message);
51 * This is the last token that has been consumed successfully. If
52 * this object has been created due to a parse error, the token
53 * following this token will (therefore) be the first error token.
58 * Each entry in this array is an array of integers. Each array
59 * of integers represents a sequence of tokens (by their ordinal
60 * values) that is expected at this point of the parse.
62 int** expectedTokenSequences;
65 * This is a reference to the "tokenImage" array of the generated
66 * parser within which the parse error occurred. This array is
67 * defined in the generated ...Constants class.
69 JAVACC_STRING_TYPE* tokenImage;
72 * It uses "currentToken" and "expectedTokenSequences" to generate a parse
73 * error message and returns it. If this object has been created
74 * due to a parse error, and you do not catch it (it gets thrown
75 * from the parser) the correct error message
78 private: JAVACC_STRING_TYPE initialise(Token currentToken,
79 int** expectedTokenSequences,
80 JAVACC_STRING_TYPE* tokenImage);
83 * The end of line string for this machine.
88 * Used to convert raw characters to their escaped version
89 * when these raw version cannot be used as part of an ASCII
92 JAVACC_STRING_TYPE add_escapes(JAVACC_STRING_TYPE str);
99 /* JavaCC - OriginalChecksum=8c47c56fc2030f05b43e20cae6ca5d66 (do not edit this line) */