pnuts.tools
Class DebugContext

java.lang.Object
  |
  +--pnuts.lang.Context
        |
        +--pnuts.tools.DebugContext

public class DebugContext
extends Context

This class is a Context used in debug mode.


Fields inherited from class pnuts.lang.Context
beginLine, defaultErrorStream, defaultOutputStream, defaultTerminalStream, depth, endLine, importEnv, loadingResource
 
Constructor Summary
DebugContext()
           
DebugContext(Context context)
           
DebugContext(Package pkg)
           
 
Method Summary
 void addCommandListener(CommandListener listener)
           
protected  void close()
          Tracks stack depth (function return) in pure interpreter
 int getCallDepth()
          Get the stack depth (in pure interpreter)
 int getEvalDepth()
          Get the depth of evaluation.
protected  void onError(java.lang.Throwable t)
          This method is called when some exception is thrown.
protected  void onExit(java.lang.Object arg)
          This method is called when an evaluation is terminated normally.
protected  void open(java.lang.String[] locals)
          Tracks stack depth (function call) in pure interpreter
 void removeCommandListener(CommandListener listener)
           
protected  void updateLine(SimpleNode node, int beginLine, int endLine)
          This method is called when line number is changed.
 
Methods inherited from class pnuts.lang.Context
clone, clone, defined, get, getCurrentPackage, getErrorStream, getId, getName, getOutputStream, getPnutsImpl, getScriptSource, getTerminalStream, keys, set, setCurrentPackage, setErrorStream, setErrorStream, setName, setOutputStream, setOutputStream, setPnutsImpl, setTerminalStream, setTerminalStream, setValue, undefinedHook, updateLine, usedPackages, usePackage
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugContext

public DebugContext()

DebugContext

public DebugContext(Package pkg)

DebugContext

public DebugContext(Context context)
Method Detail

open

protected void open(java.lang.String[] locals)
Tracks stack depth (function call) in pure interpreter
Overrides:
open in class Context

close

protected void close()
Tracks stack depth (function return) in pure interpreter
Overrides:
close in class Context

getEvalDepth

public int getEvalDepth()
Get the depth of evaluation. This value increases when load(), loadFile(), or eval() is called.

getCallDepth

public int getCallDepth()
Get the stack depth (in pure interpreter)

updateLine

protected void updateLine(SimpleNode node,
                          int beginLine,
                          int endLine)
This method is called when line number is changed.
Overrides:
updateLine in class Context

onError

protected void onError(java.lang.Throwable t)
This method is called when some exception is thrown.
Overrides:
onError in class Context

onExit

protected void onExit(java.lang.Object arg)
This method is called when an evaluation is terminated normally.
Overrides:
onExit in class Context

addCommandListener

public void addCommandListener(CommandListener listener)

removeCommandListener

public void removeCommandListener(CommandListener listener)