jcaas.script_nodes
Class ArithmeticTerm

java.lang.Object
  extended by jcaas.script_nodes.AbstractInterpretable
      extended by jcaas.script_nodes.ArithmeticTerm
All Implemented Interfaces:
Interpretable

public class ArithmeticTerm
extends AbstractInterpretable

This class represents an arithmetic_term node of a syntax tree.


Field Summary
static int DIVIDE
           
static int MULTIPLY
           
static int NONE
           
 
Constructor Summary
ArithmeticTerm(ArithmeticFactor factor)
          Constructor for when arithmetic_term ::= arithmetic_factor.
ArithmeticTerm(ArithmeticTerm term, ArithmeticFactor factor, int operation)
          Constructor for when arithmetic_term ::= arithmetic_term op arithmetic_factor, where op is MULTIPLY, for '*', or DIVIDE, for '/'.
 
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

MULTIPLY

public static final int MULTIPLY
See Also:
Constant Field Values

DIVIDE

public static final int DIVIDE
See Also:
Constant Field Values
Constructor Detail

ArithmeticTerm

public ArithmeticTerm(ArithmeticTerm term,
                      ArithmeticFactor factor,
                      int operation)
Constructor for when arithmetic_term ::= arithmetic_term op arithmetic_factor, where op is MULTIPLY, for '*', or DIVIDE, for '/'.

Parameters:
term - the term to be multiplied or divided.
factor - the factor to divide or multiply by.
operation - the operation to perform.

ArithmeticTerm

public ArithmeticTerm(ArithmeticFactor factor)
Constructor for when arithmetic_term ::= arithmetic_factor.

Parameters:
factor - the factor to drop down to in the syntax tree.
Method Detail

interpret

public void interpret(Context c)