|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpobs.errorhandler.PDefaultErrorHandler
Default error handler. Creates pretty error messages.
Constructor Summary | |
PDefaultErrorHandler(boolean showStackTrace)
|
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PDefaultErrorHandler(boolean showStackTrace)
Method Detail |
public void notifySyntaxError(long position, PParser parser)
PErrorHandler
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.
notifySyntaxError
in interface PErrorHandler
position
- Parsing position.parser
- Parser who has detected a syntax error.public void notifySemanticError(long position, java.lang.RuntimeException exception)
PErrorHandler
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.
notifySemanticError
in interface PErrorHandler
position
- Parsing position.exception
- Exception thrown by the PAction
instance.public long getErrorPosition()
PErrorHandler
getErrorPosition
in interface PErrorHandler
public boolean semanticErrorOccured()
PErrorHandler
true
if at least one semantic error occured.
semanticErrorOccured
in interface PErrorHandler
public java.lang.String createErrorMessage(PScanner input)
PErrorHandler
createErrorMessage
in interface PErrorHandler
input
- Input source of parsing.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |