Class ParseException

All Implemented Interfaces:
Serializable

public class ParseException extends Exception
Exception thrown when a parsing error occurs. Includes details about the error location and expected vs found tokens.
See Also:
  • Field Details

    • line

      private final int line
      Line number where the error occurred
    • column

      private final int column
      Column number where the error occurred
    • expected

      private final LexicalUnit expected
      The expected lexical unit
    • found

      private final LexicalUnit found
      The found lexical unit
  • Constructor Details

    • ParseException

      public ParseException(String message, int line, int column, LexicalUnit expected, LexicalUnit found)
      Constructs a ParseException with detailed information.
      Parameters:
      message - the error message
      line - the line number of the error
      column - the column number of the error
      expected - the expected lexical unit
      found - the found lexical unit
  • Method Details

    • getLine

      public int getLine()
      Returns the line number of the error.
      Returns:
      the line number
    • getColumn

      public int getColumn()
      Returns the column number of the error.
      Returns:
      the column number
    • getExpected

      public LexicalUnit getExpected()
      Returns the expected lexical unit.
      Returns:
      the expected lexical unit
    • getFound

      public LexicalUnit getFound()
      Returns the found lexical unit.
      Returns:
      the found lexical unit