|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
lp.parse.LpParserException
public class LpParserException
An exception thrown by LpParser
when it can't parse the input.
Contains information about what token the parser expected, what it found and
where. This information is accessible through getter methods
(getExpected()
, getFound()
, getLineNumber()
and
getPosition()
) and is also included in the message returned by
getMessage()
.
LpParser
,
LpTokenType
,
Serialized FormField Summary | |
---|---|
private LpTokenType |
expected
Expected token. |
private String |
found
Token found instead. |
private int |
lineNumber
Line number within the input where the problematic token was found. |
private int |
position
Line position of the problematic token's beginning. |
Constructor Summary | |
---|---|
LpParserException(LpTokenType expected,
LpLexer lexer)
Exception constructor taking the necessary information about the problematic token from a given LpLexer . |
|
LpParserException(LpTokenType expected,
String found,
int lineNumber,
int position)
Exception constructor. |
Method Summary | |
---|---|
LpTokenType |
getExpected()
Getter method for the expected token. |
String |
getFound()
Getter method for the problematic token, i.e. the token found instead of the expected token. |
int |
getLineNumber()
Getter method for number of line on which the problematic token was found. |
String |
getMessage()
Returns a message containing information about the parser problem. |
int |
getPosition()
Getter method for line position of the problematic token's beginning. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final LpTokenType expected
private final String found
private final int position
private final int lineNumber
Constructor Detail |
---|
public LpParserException(LpTokenType expected, LpLexer lexer)
LpLexer
.
expected
- expected tokenlexer
- lexer that just returned the token foundpublic LpParserException(LpTokenType expected, String found, int lineNumber, int position)
expected
- expected tokenfound
- token found instead of the expected tokenlineNumber
- number of the line where the problematic token was
foundposition
- position of the problematic token within the lineMethod Detail |
---|
public LpTokenType getExpected()
public String getFound()
public int getPosition()
public int getLineNumber()
public String getMessage()
getMessage
in class Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |