jcaas.script_nodes
Class ArithmeticExpression

java.lang.Object
  extended by jcaas.script_nodes.AbstractInterpretable
      extended by 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.


Field Summary
static int MINUS
           
static int NONE
           
static int PLUS
           
 
Constructor Summary
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 '-'.
ArithmeticExpression(ArithmeticTerm term)
          Constructor for when arithmetic_exp ::= arithmeitc_term.
 
Method Summary
 void interpret(Context c)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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.
Method Detail

interpret

public void interpret(Context c)