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.RuntimeExceptionIs 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 aParserExceptionobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetColumn()Returns the column where the error occurred.ParseErrorDetailsgetErrorDetails()Returns the detailed description of the error, ornullif none.intgetLine()Returns the line where the error occurred.LocationgetLocation()Deprecated.UsegetLine()andgetColumn()instead.java.lang.StringgetModuleName()Deprecated.ParseTreegetParseTree()Returns the parse tree until the parse error happened, whenparseTree()was invoked.voidsetParseTree(ParseTree parseTree)private static java.lang.StringtoErrorMessage(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 aParserExceptionobject.- Parameters:
details- theParseErrorDetailsthat describes the error details.location- the error location.
-
ParserException
@Deprecated public ParserException(ParseErrorDetails details, java.lang.String moduleName, Location location)
Deprecated.Creates aParserExceptionobject.- Parameters:
details- theParseErrorDetailsthat 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 aParserExceptionobject.- Parameters:
cause- the exception that causes this.details- theParseErrorDetailsthat describes the error details.moduleName- the module name.location- the location.
-
-
Method Detail
-
getErrorDetails
public ParseErrorDetails getErrorDetails()
Returns the detailed description of the error, ornullif none.
-
getParseTree
public ParseTree getParseTree()
Returns the parse tree until the parse error happened, whenparseTree()was invoked.nullif 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, ornullif 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
-
-