|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tenua.symbol.Symbol
public abstract class Symbol
Represents something (numbers, id's, operators)
that can be part of an Expression
Field Summary | |
---|---|
static Symbol |
CLEAR_STACK
a Symbol that clears the stack |
static java.lang.Integer |
maxPrecedence
the maximum precedence. |
Method Summary | |
---|---|
abstract void |
eval(DoubleStack s,
VariableMemento v)
evaluate the Symbol |
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, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Integer maxPrecedence
public static final Symbol CLEAR_STACK
Method Detail |
---|
public abstract void eval(DoubleStack s, VariableMemento v)
s
- the stack from which to pop arguments and to which to
push resultsv
- the memento representing the current values of variables.
If v is null, then use the default valuespublic void toString(java.util.Stack stringStack, java.util.Stack precedenceStack, SymbolTable st)
stringStack
- the stack of StringBuffer from which to pop arguments
and to which to push resultsprecedenceStack
- 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
maxPrecedence
st
- the SymbolTable
to get Symbol names from
Note: the name is a misnomer; it uses StringBuffer's, not String's
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |