jfun.parsec.trace
Class Traces

java.lang.Object
  extended by jfun.parsec.trace.Traces

public class Traces
extends java.lang.Object

This class provides some common trace implementations.

Since:
version 1.1 May 9, 2006 7:25:19 PM
Author:
Ben Yu

Constructor Summary
Traces()
           
 
Method Summary
static Trace<java.lang.Object> printError(java.lang.String name, java.io.PrintWriter out, int min_steps)
          Create a Trace object that prints error message to output.
static Trace<java.lang.Object> printResult(java.lang.String name, java.io.PrintWriter out)
          Create a Trace object that prints trace message to output when parser succeeds.
static Trace<java.lang.Object> printTrace(java.lang.String name, java.io.PrintWriter out)
          Create a Trace object that prints trace message to output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Traces

public Traces()
Method Detail

printError

public static Trace<java.lang.Object> printError(java.lang.String name,
                                                 java.io.PrintWriter out,
                                                 int min_steps)
Create a Trace object that prints error message to output.

Parameters:
name - the name in the trace message.
out - the writer for the output.
min_steps - the minimal logical steps consumed to trigger the trace message.
Returns:
the Trace object.

printResult

public static Trace<java.lang.Object> printResult(java.lang.String name,
                                                  java.io.PrintWriter out)
Create a Trace object that prints trace message to output when parser succeeds.

Parameters:
name - the name in the trace message.
out - the writer for the output.
Returns:
the Trace object.

printTrace

public static Trace<java.lang.Object> printTrace(java.lang.String name,
                                                 java.io.PrintWriter out)
Create a Trace object that prints trace message to output. The minimal logical steps to trigger an error message is 1.

Parameters:
name - the name in the trace message.
out - the writer for the output.
Returns:
the Trace object.