Class TokenMgrError
java.lang.Object
java.lang.Throwable
java.lang.Error
org.tweetyproject.arg.delp.parser.TokenMgrError
-
Constructor Summary
ConstructorDescriptionNo arg constructor.TokenMgrError
(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) Constructs a newTokenMgrError
with detailed information about a lexical error.TokenMgrError
(String message, int reason) Constructs a newTokenMgrError
with a specified error message and reason code. -
Method Summary
Modifier and TypeMethodDescriptionYou can also modify the body of this method to customize your error messages.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TokenMgrError
public TokenMgrError()No arg constructor. -
TokenMgrError
Constructs a newTokenMgrError
with a specified error message and reason code.This constructor initializes the error with a descriptive message and an integer code that represents the specific reason for the error. The message typically describes what went wrong, while the reason code can be used to identify the type of error.
- Parameters:
message
- A description of the error.reason
- An integer code representing the type of error.
-
TokenMgrError
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) Constructs a newTokenMgrError
with detailed information about a lexical error.This constructor generates an error message based on the context in which the error occurred, including whether the end-of-file (EOF) was encountered, the current lexical state, the position in the input (line and column), the text immediately following the error, and the character that caused the error. It also includes a reason code for further categorization of the error.
- Parameters:
EOFSeen
- A boolean indicating whether the end-of-file (EOF) was encountered during the error.lexState
- The lexical state of the parser when the error occurred.errorLine
- The line number where the error occurred.errorColumn
- The column number where the error occurred.errorAfter
- The text that was parsed immediately before the error occurred.curChar
- The character that caused the error.reason
- An integer code representing the type of error.
-
-
Method Details
-
getMessage
You can also modify the body of this method to customize your error messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not of end-users concern, so you can return something like : "Internal Error : Please file a bug report .... " from this method for such cases in the release version of your parser.- Overrides:
getMessage
in classThrowable
-