GNU Prolog for Java

gnu.prolog.vm.interpreter
Class Tracer

java.lang.Object
  extended by gnu.prolog.vm.interpreter.Tracer

public class Tracer
extends Object

Author:
Michiel Hendriks

Nested Class Summary
static class Tracer.TraceLevel
          Different trace levels
 
Field Summary
protected  CompoundTermTag[] callStack
           
protected static int callStackGrow
           
protected  int callStackMax
           
protected  int callStackPointer
           
protected  Set<TracerEventListener> listeners
           
protected  PrologStream output
           
protected  Map<CompoundTermTag,EnumSet<Tracer.TraceLevel>> tracePoints
          Current active trace points
protected  boolean tracingActive
          If tracing is active
static Set<CompoundTermTag> UNTRACEABLE
           
 
Constructor Summary
Tracer(PrologStream stdout)
           
 
Method Summary
 void addTrace(CompoundTermTag pred, EnumSet<Tracer.TraceLevel> levels)
          Set a trace point
 void addTrace(CompoundTermTag pred, Tracer.TraceLevel level)
           
 void addTracerEventListener(TracerEventListener listener)
           
 void decreaseDepth()
           
 CompoundTermTag[] getCallStack()
           
 boolean isActive()
           
protected  void println(String string)
           
 void removeAllTraces()
          Remove all trace points
 void removeTrace(CompoundTermTag pred)
          Remove a trace point
 void removeTrace(CompoundTermTag pred, EnumSet<Tracer.TraceLevel> levels)
          Remove a given level
 void removeTrace(CompoundTermTag pred, Tracer.TraceLevel level)
           
 void removeTracerEventListener(TracerEventListener listener)
           
 void reportStatus()
           
protected  void sendEvent(Tracer.TraceLevel level, Interpreter interpreter, CompoundTermTag tag, Term[] args)
          Notify the listeners
 void setActive(boolean tracingActive)
          Enable/disable tracing
 void setTrace(CompoundTermTag pred, EnumSet<Tracer.TraceLevel> levels)
           
 void traceEvent(Tracer.TraceLevel level, Interpreter interpreter, CompoundTermTag tag, Term[] args)
          A trace event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNTRACEABLE

public static final Set<CompoundTermTag> UNTRACEABLE

tracingActive

protected boolean tracingActive
If tracing is active


tracePoints

protected Map<CompoundTermTag,EnumSet<Tracer.TraceLevel>> tracePoints
Current active trace points


output

protected PrologStream output

listeners

protected Set<TracerEventListener> listeners

callStackGrow

protected static final int callStackGrow
See Also:
Constant Field Values

callStack

protected CompoundTermTag[] callStack

callStackPointer

protected int callStackPointer

callStackMax

protected int callStackMax
Constructor Detail

Tracer

public Tracer(PrologStream stdout)
Parameters:
stdout -
Method Detail

addTracerEventListener

public void addTracerEventListener(TracerEventListener listener)

removeTracerEventListener

public void removeTracerEventListener(TracerEventListener listener)

setActive

public void setActive(boolean tracingActive)
Enable/disable tracing

Parameters:
tracingActive -

isActive

public boolean isActive()
Returns:
True if tracing is active

setTrace

public void setTrace(CompoundTermTag pred,
                     EnumSet<Tracer.TraceLevel> levels)
Parameters:
pred -
levels -

addTrace

public void addTrace(CompoundTermTag pred,
                     EnumSet<Tracer.TraceLevel> levels)
Set a trace point

Parameters:
pred -
levels -

addTrace

public void addTrace(CompoundTermTag pred,
                     Tracer.TraceLevel level)
Parameters:
pred -
level -

removeTrace

public void removeTrace(CompoundTermTag pred)
Remove a trace point

Parameters:
pred -

removeTrace

public void removeTrace(CompoundTermTag pred,
                        EnumSet<Tracer.TraceLevel> levels)
Remove a given level

Parameters:
pred -
levels -

removeTrace

public void removeTrace(CompoundTermTag pred,
                        Tracer.TraceLevel level)
Parameters:
pred -
level -

removeAllTraces

public void removeAllTraces()
Remove all trace points


getCallStack

public CompoundTermTag[] getCallStack()

decreaseDepth

public void decreaseDepth()

traceEvent

public void traceEvent(Tracer.TraceLevel level,
                       Interpreter interpreter,
                       CompoundTermTag tag,
                       Term[] args)
A trace event

Parameters:
level -
interpreter -
tag -
args -

sendEvent

protected void sendEvent(Tracer.TraceLevel level,
                         Interpreter interpreter,
                         CompoundTermTag tag,
                         Term[] args)
Notify the listeners

Parameters:
level -
interpreter -
tag -
args -

println

protected void println(String string)

reportStatus

public void reportStatus()

GNU Prolog for Java