jfun.parsec.trace
Interface Trace<T>

All Known Implementing Classes:
EmptyTrace

public interface Trace<T>

This interface is used to trace parser result.

Since:
version 1.1 May 9, 2006 7:18:31 PM
Author:
Ben Yu

Method Summary
 void onError(java.lang.Object except, java.lang.CharSequence src, int index, int steps, int offset)
          This method is called when parser failed.
 void onSuccess(T result, java.lang.CharSequence src, int index, int steps, int offset)
          This method is called when parser succeeded.
 

Method Detail

onError

void onError(java.lang.Object except,
             java.lang.CharSequence src,
             int index,
             int steps,
             int offset)
This method is called when parser failed.

Parameters:
except - the pseudo exception object. null if no exception.
src - the text being parsed.
index - the index where the parser terminates.
steps - the logical steps consumed.
offset - the physical offset consumed.

onSuccess

void onSuccess(T result,
               java.lang.CharSequence src,
               int index,
               int steps,
               int offset)
This method is called when parser succeeded.

Parameters:
result - the parser result.
src - the text being parsed.
index - the index where the parser terminates.
steps - the logical steps consumed.
offset - the physical offset consumed.