Class ParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ParseException
- All Implemented Interfaces:
Serializable
Exception thrown when a parsing error occurs.
Includes details about the error location and expected vs found tokens.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intColumn number where the error occurredprivate final LexicalUnitThe expected lexical unitprivate final LexicalUnitThe found lexical unitprivate final intLine number where the error occurred -
Constructor Summary
ConstructorsConstructorDescriptionParseException(String message, int line, int column, LexicalUnit expected, LexicalUnit found) Constructs a ParseException with detailed information. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
line
private final int lineLine number where the error occurred -
column
private final int columnColumn number where the error occurred -
expected
The expected lexical unit -
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 messageline- the line number of the errorcolumn- the column number of the errorexpected- the expected lexical unitfound- 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
Returns the expected lexical unit.- Returns:
- the expected lexical unit
-
getFound
Returns the found lexical unit.- Returns:
- the found lexical unit
-