miSim

misim.asm
Class Expr

java.lang.Object
  |
  +--misim.asm.Expr
Direct Known Subclasses:
Context

public class Expr
extends java.lang.Object

The Expression class provides the means to evaluate a numeric expression in a file.


Constructor Summary
Expr()
          Constructor method, which initialises the operator and operand stacks
 
Method Summary
 int evaluate(TokenIterator tokens, Context context, boolean evalBool)
          Evaluate the numeric expression in a file, beginning at the given token position.
 int evaluate(TokenIterator tokens, Context context, Label aLabel, TokenOperator assignment)
           
 void evaluateOperation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expr

public Expr()
Constructor method, which initialises the operator and operand stacks
Method Detail

evaluate

public int evaluate(TokenIterator tokens,
                    Context context,
                    boolean evalBool)
             throws EditorException
Evaluate the numeric expression in a file, beginning at the given token position.
Parameters:
tokens - The TokenIterator for the line being assembled
context - The local context for this line
evalBool - True if the expression should evaluate as boolean
Returns:
The integer value of the given expression
Throws:
AssemblerException - if the expression contains an error.

evaluate

public int evaluate(TokenIterator tokens,
                    Context context,
                    Label aLabel,
                    TokenOperator assignment)
             throws EditorException

evaluateOperation

public void evaluateOperation()
                       throws EditorException

miSim