jcaas.script_nodes
Class ArithmeticExpression
java.lang.Object
jcaas.script_nodes.AbstractInterpretable
jcaas.script_nodes.ArithmeticExpression
- All Implemented Interfaces:
- Interpretable
public class ArithmeticExpression
- extends AbstractInterpretable
This class represents an arithmetic_exp node in the syntax tree of a script file.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NONE
public static final int NONE
- See Also:
- Constant Field Values
PLUS
public static final int PLUS
- See Also:
- Constant Field Values
MINUS
public static final int MINUS
- See Also:
- Constant Field Values
ArithmeticExpression
public ArithmeticExpression(ArithmeticExpression exp,
ArithmeticTerm term,
int operation)
- Constructor for when an arithmetic_exp ::= arithmetic_exp op arithmetic_term where op
is the constant PLUS, for '+', or MINUS, for '-'.
- Parameters:
exp
- another arithmetic_exp to add or subtract something to.term
- the term to add or subtract.operation
- the operation to perform.
ArithmeticExpression
public ArithmeticExpression(ArithmeticTerm term)
- Constructor for when arithmetic_exp ::= arithmeitc_term.
- Parameters:
term
- the term to drop down to in the syntax tree.
interpret
public void interpret(Context c)