Class TokenMgrError

java.lang.Object
java.lang.Throwable
java.lang.Error
org.tweetyproject.lp.asp.parser.TokenMgrError
All Implemented Interfaces:
Serializable

public class TokenMgrError extends Error
Token Manager Error.
See Also:
  • Constructor Details

    • TokenMgrError

      public TokenMgrError()
      No arg constructor.
    • TokenMgrError

      public TokenMgrError(String message, int reason)
      Constructs a new TokenMgrError 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 new TokenMgrError 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 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 if the end-of-file 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

      public String 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 class Throwable
      Returns:
      the message