jfun.parsec.trace
Class EmptyTrace<T>
java.lang.Object
jfun.parsec.trace.EmptyTrace<T>
- All Implemented Interfaces:
- Trace<T>
public abstract class EmptyTrace<T>
- extends java.lang.Object
- implements Trace<T>
This class provides an empty implementation of Trace.
- 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)
Override this method when only error tracing is needed. |
void |
onSuccess(T result,
java.lang.CharSequence src,
int index,
int steps,
int offset)
Override this method when tracing is only needed when the parser succeeds. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmptyTrace
public EmptyTrace()
onError
public void onError(java.lang.Object except,
java.lang.CharSequence src,
int index,
int steps,
int offset)
- Override this method when only error tracing is needed.
- Specified by:
onError
in interface Trace<T>
- 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
public void onSuccess(T result,
java.lang.CharSequence src,
int index,
int steps,
int offset)
- Override this method when tracing is only needed when the parser succeeds.
- Specified by:
onSuccess
in interface Trace<T>
- 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.