pnuts.tools
Class TerminalDebugger

java.lang.Object
  |
  +--pnuts.lang.Runtime
        |
        +--pnuts.tools.TerminalDebugger
All Implemented Interfaces:
CommandListener, ContextFactory, java.util.EventListener, PnutsParserTreeConstants

public class TerminalDebugger
extends Runtime
implements ContextFactory, CommandListener, PnutsParserTreeConstants

This class implements a debugger for Pnuts interpreter. It is used through pnuts -d command.

 Commands:
   stop at [FILE:]LINENO
       Stop execution at the LINENO
   stop in FUNC[:NARGS]
       Stop execution when FUNC is called.
       When NARGS is specified, stop when FUNC with NARGS is called.
   clear
       Clear all breakpoints
   cont
       Continue execution
   trace
       Toggle trace mode
   step [NUM]
       Single step NUM lines.  The default number is 1.
   step up
       Step out of the current function
   next [NUM]
       Step NUM line (step OVER calls).  The default number is 1.
   help
       Print a summary of commands
   ?
       Same as help.
  


Fields inherited from interface pnuts.lang.PnutsParserTreeConstants
JJTADDNODE, JJTANDNODE, JJTAPPLICATIONNODE, JJTARRAYTYPE, JJTASSIGNMENT, JJTASSIGNMENTAA, JJTASSIGNMENTDA, JJTASSIGNMENTEA, JJTASSIGNMENTLA, JJTASSIGNMENTMA, JJTASSIGNMENTOA, JJTASSIGNMENTPA, JJTASSIGNMENTRA, JJTASSIGNMENTRAA, JJTASSIGNMENTSA, JJTASSIGNMENTTA, JJTBLOCK, JJTBREAK, JJTCASTEXPRESSION, JJTCATCHNODE, JJTCHARACTERNODE, JJTCLASS, JJTCONTINUE, JJTDIVIDENODE, JJTELSEIFNODE, JJTELSENODE, JJTEQUALNODE, JJTEXPRESSIONLIST, JJTFALSENODE, JJTFLOATINGNODE, JJTFOREACHSTATEMENT, JJTFORINIT, JJTFORSTATEMENT, JJTFORUPDATE, JJTFUNCTIONSTATEMENT, JJTGENODE, JJTGLOBAL, JJTGTNODE, JJTIDNODE, JJTIFSTATEMENT, JJTINDEXNODE, JJTINSTANCEOFEXPRESSION, JJTINTEGERNODE, JJTLENODE, JJTLISTELEMENTS, JJTLOCAL, JJTLOGANDNODE, JJTLOGEXORNODE, JJTLOGNOTNODE, JJTLOGORNODE, JJTLTNODE, JJTMEMBERNODE, JJTMETHODNODE, JJTMODNODE, JJTMULTNODE, JJTNEGATIVENODE, jjtNodeName, JJTNOTEQNODE, JJTNOTNODE, JJTNULLNODE, JJTORNODE, JJTPACKAGE, JJTPARAM, JJTPARAMLIST, JJTPOSTDECRNODE, JJTPOSTINCRNODE, JJTPREDECRNODE, JJTPREINCRNODE, JJTRANGENODE, JJTRETURN, JJTSHIFTARITHMETICNODE, JJTSHIFTLEFTNODE, JJTSHIFTRIGHTNODE, JJTSTART, JJTSTARTSET, JJTSTATICMEMBERNODE, JJTSTATICMETHODNODE, JJTSTRINGNODE, JJTSUBTRACTNODE, JJTSWITCHBLOCK, JJTSWITCHLABEL, JJTSWITCHSTATEMENT, JJTTRUENODE, JJTVOID, JJTWHILESTATEMENT
 
Constructor Summary
TerminalDebugger()
           
TerminalDebugger(java.io.Reader reader)
           
 
Method Summary
 Context createContext()
          Create a context
 void signal(CommandEvent event)
          Some kind of event raised, e.g.
 
Methods inherited from class pnuts.lang.Runtime
arrayType, assignRange, binary, call, callConstructor, callConstructor, callConstructor, callFunction, callMethod, callMethod, callMethod, cast, catchException, checkException, checkException, compareTo, escape, exec, execute, fileToURL, format, getBeginLine, getBottomType, getCompiledScript, getEndLine, getField, getFunction, getFunction, getFunctions, getIndex, getRuntime, getScriptSource, getScriptURL, getStaticField, isArray, jump, matchType, namespaceRefreshed, newInstance, parseChar, parseFloat, parseInt, parseString, primitive, printError, putField, putStaticField, quantity, range, readSymbolTable, setLine, setLine, setPackage, transform, unary, writeSymbolTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalDebugger

public TerminalDebugger()

TerminalDebugger

public TerminalDebugger(java.io.Reader reader)
Parameters:
reader - debug script to read in
Method Detail

createContext

public Context createContext()
Description copied from interface: ContextFactory
Create a context
Specified by:
createContext in interface ContextFactory

signal

public void signal(CommandEvent event)
Description copied from interface: CommandListener
Some kind of event raised, e.g. the line number has changed.
Specified by:
signal in interface CommandListener