|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface of all error handlers. An error handler is called if a parser found a mismatch.
Method Summary | |
java.lang.String |
createErrorMessage(PScanner input)
Creates a human readable error message using the specified input to get reasonable error positions (like line number and column number). |
long |
getErrorPosition()
Gets the actual error position. |
void |
notifySemanticError(long position,
java.lang.RuntimeException exception)
Notifies the error handler that a semantic error occured during execution of a PAction attached to the specified parser.
|
void |
notifySyntaxError(long position,
PParser parser)
Notifies the error handler that a syntax error occured for the specified parser at the specified parsing position. |
boolean |
semanticErrorOccured()
Returns true if at least one semantic error occured. |
Method Detail |
public void notifySyntaxError(long position, PParser parser)
From both types of notifiction
events concrete implementations must find out where the actual error
occured and what is its reason. For the later
PParser.getErrorInfo()
can be used.
position
- Parsing position.parser
- Parser who has detected a syntax error.public void notifySemanticError(long position, java.lang.RuntimeException exception)
PAction
attached to the specified parser.
This method might be called several
times even if complete parsing is successful.
From both types of notifiction
events concrete implementations must find out where the actual error
occured and what is its reason. For the later
exception.getMessage()
can be used.
position
- Parsing position.exception
- Exception thrown by the PAction
instance.public long getErrorPosition()
public boolean semanticErrorOccured()
true
if at least one semantic error occured.
public java.lang.String createErrorMessage(PScanner input)
input
- Input source of parsing.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |