pobs
Class PDefaultErrorHandler

java.lang.Object
  extended bypobs.PDefaultErrorHandler
All Implemented Interfaces:
PErrorHandler

public class PDefaultErrorHandler
extends java.lang.Object
implements PErrorHandler

Author:
Franz-Josef Elmer

Constructor Summary
PDefaultErrorHandler()
           
 
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 notify(long position, PParser parser)
          Notifies the error handler that an error occured for the specified parser at the specified parsing position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDefaultErrorHandler

public PDefaultErrorHandler()
Method Detail

notify

public void notify(long position,
                   PParser parser)
Description copied from interface: PErrorHandler
Notifies the error handler that an error occured for the specified parser at the specified parsing position. This method might be called several times even if complete parsing is successful.

Specified by:
notify in interface PErrorHandler
Parameters:
position - Parsing position.
parser - Parser which recognized a missmatch.

getErrorPosition

public long getErrorPosition()
Description copied from interface: PErrorHandler
Gets the actual error position.

Specified by:
getErrorPosition in interface PErrorHandler
Returns:
actual parsing position where the error occured.

createErrorMessage

public java.lang.String createErrorMessage(PScanner input)
Description copied from interface: PErrorHandler
Creates a human readable error message using the specified input to get reasonable error positions (like line number and column number).

Specified by:
createErrorMessage in interface PErrorHandler
Parameters:
input - Input source of parsing.
Returns:
error message.