Class PrologParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.igormaznitsa.prologparser.exceptions.PrologParserException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CharBufferOverflowException
Exception is thrown if any problem with parsing of prolog sources.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionPrologParserException(String text, int line, int pos) ConstructorPrologParserException(String text, int line, int pos, Throwable cause) Constructor -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
line
protected final int line -
pos
protected final int pos
-
-
Constructor Details
-
PrologParserException
Constructor- Parameters:
text- text of parsing errorline- line where the error has been detectedpos- line position where the error has been detected
-
PrologParserException
Constructor- Parameters:
text- text of parsing errorline- line where the error has been detectedpos- line position where the error has been detectedcause- the root exception
-
-
Method Details
-
getLine
public int getLine()Get the error line, first line has index 1- Returns:
- the error line, -1 if the line is undefined
-
getPos
public int getPos()Get the error line position, first position has index 1- Returns:
- the error line position, -1 if the position is undefined
-
hasValidPosition
public boolean hasValidPosition()Check that the exception contains valid position- Returns:
- true if position and line have been defined in the exception
-
toString
-