KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > trace > EmptyTrace


1 package jfun.parsec.trace;
2
3 /**
4  * This class provides an empty implementation of Trace.
5  * <p>
6  * @author Ben Yu
7  * @since version 1.1
8  * May 9, 2006 7:18:31 PM
9  */

10 public abstract class EmptyTrace<T> implements Trace<T>{
11   /**
12    * Override this method when only error tracing is needed.
13    * @param except the pseudo exception object. null if no exception.
14    * @param src the text being parsed.
15    * @param index the index where the parser terminates.
16    * @param steps the logical steps consumed.
17    * @param offset the physical offset consumed.
18    */

19   public void onError(Object JavaDoc except, CharSequence JavaDoc src, int index, int steps, int offset){}
20   
21   /**
22    * Override this method when tracing is only needed when the parser succeeds.
23    * @param result the parser result.
24    * @param src the text being parsed.
25    * @param index the index where the parser terminates.
26    * @param steps the logical steps consumed.
27    * @param offset the physical offset consumed.
28    */

29   public void onSuccess(T result, CharSequence JavaDoc src, int index, int steps, int offset){}
30 }
31
Popular Tags