| 1 |
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.0 */ |
| 2 |
/* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ |
| 3 |
#ifndef _TOKENMGRERROR_H |
| 4 |
#define _TOKENMGRERROR_H |
| 5 |
#include "JavaCC.h" |
| 6 |
|
| 7 |
|
| 8 |
namespace Konclude { |
| 9 |
namespace Parser { |
| 10 |
namespace FunctionalJAVACC { |
| 11 |
|
| 12 |
enum LexerErrors { |
| 13 |
/** |
| 14 |
* Lexical error occurred. |
| 15 |
*/ |
| 16 |
LEXICAL_ERROR = 0, |
| 17 |
|
| 18 |
/** |
| 19 |
* An attempt was made to create a second instance of a token manager. |
| 20 |
*/ |
| 21 |
STATIC_LEXER_ERROR = 1, |
| 22 |
|
| 23 |
/** |
| 24 |
* Tried to change to an invalid lexical state. |
| 25 |
*/ |
| 26 |
INVALID_LEXICAL_STATE = 2, |
| 27 |
|
| 28 |
/** |
| 29 |
* Detected (and bailed out of) an infinite loop in the token manager. |
| 30 |
*/ |
| 31 |
LOOP_DETECTED = 3, |
| 32 |
}; |
| 33 |
|
| 34 |
class TokenMgrError |
| 35 |
{ |
| 36 |
public: |
| 37 |
/* |
| 38 |
* Ordinals for various reasons why an Error of this type can be thrown. |
| 39 |
*/ |
| 40 |
|
| 41 |
/** |
| 42 |
* Indicates the reason why the exception is thrown. It will have |
| 43 |
* one of the above 4 values. |
| 44 |
*/ |
| 45 |
int errorCode; |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns a detailed message for the Error when it is thrown by the |
| 49 |
* token manager to indicate a lexical error. |
| 50 |
* Parameters : |
| 51 |
* EOFSeen : indicates if EOF caused the lexical error |
| 52 |
* curLexState : lexical state in which this error occurred |
| 53 |
* errorLine : line number when the error occurred |
| 54 |
* errorColumn : column number when the error occurred |
| 55 |
* errorAfter : prefix that was seen before this error occurred |
| 56 |
* curchar : the offending character |
| 57 |
* Note: You can customize the lexical error message by modifying this method. |
| 58 |
*/ |
| 59 |
JAVACC_STRING_TYPE LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar); |
| 60 |
|
| 61 |
private: JAVACC_STRING_TYPE message; |
| 62 |
|
| 63 |
/** |
| 64 |
* You can also modify the body of this method to customize your error messages. |
| 65 |
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not |
| 66 |
* of end-users concern, so you can return something like : |
| 67 |
* |
| 68 |
* "Internal Error : Please file a bug report .... " |
| 69 |
* |
| 70 |
* from this method for such cases in the release version of your parser. |
| 71 |
*/ |
| 72 |
JAVACC_STRING_TYPE getMessage() ; |
| 73 |
|
| 74 |
/* |
| 75 |
* Constructors of various flavors follow. |
| 76 |
*/ |
| 77 |
|
| 78 |
/** No arg constructor. */ |
| 79 |
public: TokenMgrError() ; |
| 80 |
|
| 81 |
/** Constructor with message and reason. */ |
| 82 |
public: TokenMgrError(JAVACC_STRING_TYPE message, int reason) ; |
| 83 |
|
| 84 |
/** Full Constructor. */ |
| 85 |
public: TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) ; |
| 86 |
}; |
| 87 |
|
| 88 |
} |
| 89 |
} |
| 90 |
} |
| 91 |
#endif |
| 92 |
/* JavaCC - OriginalChecksum=65100ff7bfda78447381f7aed74fe139 (do not edit this line) */ |