Class Unary

  extended by tenua.symbol.Symbol
      extended by tenua.symbol.Unary

public abstract class Unary
extends Symbol

A Symbol that represents a unary operator. does nothing that a regular Symbol doesn't. but is useful for distinguishing types

Daniel Wachsstock

Field Summary
static Unary EXP
static Unary LN
static Unary NEGATE
static Unary NOT
Fields inherited from class tenua.symbol.Symbol
CLEAR_STACK, maxPrecedence
Method Summary
 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 tenua.symbol.Symbol
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final Unary NEGATE


public static final Unary NOT


public static final Unary EXP


public static final Unary LN
Method Detail


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