tenua.gui
Class CompilerTimer

java.lang.Object
  extended by java.util.Timer
      extended by tenua.gui.CompilerTimer

public class CompilerTimer
extends java.util.Timer

Sets up a timer loop to run the compiler on a regular basis

Author:
Daniel Wachsstock

Constructor Summary
CompilerTimer(Tenua parent)
          Creates a new CompilerTimer
 
Method Summary
 void compile()
          called by other threads to alert this one that the mechanism has changed
static java.lang.String compileMacro(java.lang.String s, SymbolTable st)
          compiles a string with a given SymbolTable into a macro that can be executed by a mechanism.
 
Methods inherited from class java.util.Timer
cancel, purge, schedule, schedule, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilerTimer

public CompilerTimer(Tenua parent)
Creates a new CompilerTimer

Parameters:
parent - the Tenua window that created this
Method Detail

compile

public void compile()
called by other threads to alert this one that the mechanism has changed


compileMacro

public static java.lang.String compileMacro(java.lang.String s,
                                            SymbolTable st)
                                     throws tenua.parser.ParseException
compiles a string with a given SymbolTable into a macro that can be executed by a mechanism. It translates the variables into get/sut method calls.

Parameters:
s - the String to compile
st - the SymbolTable to use
Returns:
a String with s appropriately mangled, to be used with bsh.Interpreter.eval (String)
Throws:
tenua.parser.ParseException