Package org.jparsec.error
Class ParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.jparsec.error.ParserException
- All Implemented Interfaces:
Serializable
Is thrown when any grammar error happens or any exception is thrown during parsing.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParserException
(Throwable cause, ParseErrorDetails details, String moduleName, Location location) Deprecated.ParserException
(ParseErrorDetails details, String moduleName, Location location) Deprecated.ParserException
(ParseErrorDetails details, Location location) Creates aParserException
object. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Returns the column where the error occurred.Returns the detailed description of the error, ornull
if none.final int
getLine()
Returns the line where the error occurred.Deprecated.Deprecated.Returns the parse tree until the parse error happened, whenparseTree()
was invoked.void
setParseTree
(ParseTree parseTree) private static String
toErrorMessage
(String message, String module, ParseErrorDetails details, Location location) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
error
-
location
-
parseTree
-
module
Deprecated.
-
-
Constructor Details
-
ParserException
Creates aParserException
object.- Parameters:
details
- theParseErrorDetails
that describes the error details.location
- the error location.
-
ParserException
Deprecated.Creates aParserException
object.- Parameters:
details
- theParseErrorDetails
that describes the error details.moduleName
- the module name.location
- the error location.
-
ParserException
@Deprecated public ParserException(Throwable cause, ParseErrorDetails details, String moduleName, Location location) Deprecated.Creates aParserException
object.- Parameters:
cause
- the exception that causes this.details
- theParseErrorDetails
that describes the error details.moduleName
- the module name.location
- the location.
-
-
Method Details
-
getErrorDetails
Returns the detailed description of the error, ornull
if none. -
getParseTree
Returns the parse tree until the parse error happened, whenparseTree()
was invoked.null
if absent.- Since:
- 2.3
-
setParseTree
- Since:
- 2.3
-
toErrorMessage
private static String toErrorMessage(String message, String module, ParseErrorDetails details, Location location) -
getModuleName
Deprecated.Returns the module name, ornull
if none. -
getLocation
Deprecated.UsegetLine()
andgetColumn()
instead.Returns the location of the error. -
getLine
public final int getLine()Returns the line where the error occurred.- Since:
- 3.1
-
getColumn
public final int getColumn()Returns the column where the error occurred.- Since:
- 3.1
-
getLine()
andgetColumn()
instead.