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:
java.io.Serializable
public class ParserException extends java.lang.RuntimeException
Is thrown when any grammar error happens or any exception is thrown during parsing.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ParserException(java.lang.Throwable cause, ParseErrorDetails details, java.lang.String moduleName, Location location)
Deprecated.ParserException(ParseErrorDetails details, java.lang.String moduleName, Location location)
Deprecated.ParserException(ParseErrorDetails details, Location location)
Creates aParserException
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getColumn()
Returns the column where the error occurred.ParseErrorDetails
getErrorDetails()
Returns the detailed description of the error, ornull
if none.int
getLine()
Returns the line where the error occurred.Location
getLocation()
Deprecated.UsegetLine()
andgetColumn()
instead.java.lang.String
getModuleName()
Deprecated.ParseTree
getParseTree()
Returns the parse tree until the parse error happened, whenparseTree()
was invoked.void
setParseTree(ParseTree parseTree)
private static java.lang.String
toErrorMessage(java.lang.String message, java.lang.String module, ParseErrorDetails details, Location location)
-
-
-
Field Detail
-
error
private final ParseErrorDetails error
-
location
private final Location location
-
parseTree
private ParseTree parseTree
-
module
@Deprecated private final java.lang.String module
Deprecated.
-
-
Constructor Detail
-
ParserException
public ParserException(ParseErrorDetails details, Location location)
Creates aParserException
object.- Parameters:
details
- theParseErrorDetails
that describes the error details.location
- the error location.
-
ParserException
@Deprecated public ParserException(ParseErrorDetails details, java.lang.String moduleName, Location location)
Deprecated.Creates aParserException
object.- Parameters:
details
- theParseErrorDetails
that describes the error details.moduleName
- the module name.location
- the error location.
-
ParserException
@Deprecated public ParserException(java.lang.Throwable cause, ParseErrorDetails details, java.lang.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 Detail
-
getErrorDetails
public ParseErrorDetails getErrorDetails()
Returns the detailed description of the error, ornull
if none.
-
getParseTree
public ParseTree getParseTree()
Returns the parse tree until the parse error happened, whenparseTree()
was invoked.null
if absent.- Since:
- 2.3
-
setParseTree
public void setParseTree(ParseTree parseTree)
- Since:
- 2.3
-
toErrorMessage
private static java.lang.String toErrorMessage(java.lang.String message, java.lang.String module, ParseErrorDetails details, Location location)
-
getModuleName
@Deprecated public java.lang.String getModuleName()
Deprecated.Returns the module name, ornull
if none.
-
getLocation
@Deprecated public Location 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
-
-