Class Interpreted

  extended by tenua.symbol.Symbol
      extended by tenua.symbol.Interpreted

public class Interpreted
extends Symbol

A Symbol that uses the BeanShell interpreter to evaluate itself

Daniel Wachsstock

Field Summary
Fields inherited from class tenua.symbol.Symbol
CLEAR_STACK, maxPrecedence
Constructor Summary
Interpreted(java.lang.String name, int numArgs, bsh.Interpreter interpreter)
Method Summary
 void eval(DoubleStack s, VariableMemento v)
          evaluate this symbol.
 java.lang.String toString()
 void toString(java.util.Stack stringStack, java.util.Stack precedenceStack, SymbolTable st)
          pushes a StringBuffer that reflects this Symbol, with all its arguments
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public Interpreted(java.lang.String name,
                   int numArgs,
                   bsh.Interpreter interpreter)
Method Detail


public void eval(DoubleStack s,
                 VariableMemento v)
evaluate this symbol.

Specified by:
eval in class Symbol
s - the stack from which to pull arguments and to which to push the result if and only if it is a Number
v - ignored


public java.lang.String toString()
toString in class java.lang.Object


public void toString(java.util.Stack stringStack,
                     java.util.Stack precedenceStack,
                     SymbolTable st)
Description copied from class: Symbol
pushes a StringBuffer that reflects this Symbol, with all its arguments

toString in class Symbol
stringStack - the stack of StringBuffer from which to pop arguments and to which to push results
precedenceStack - a stack to be push'ed and pop'ed in parallel with stringStack that contains Integers, corresponding to the precedence of the arguments onstringStack. This is used to determine placement of parentheses. Anything other than a binary operation should push Symbol.maxPrecedence
st - the SymbolTable to get Symbol names from Note: the name is a misnomer; it uses StringBuffer's, not String's