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