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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Expr
public Expr()
- Constructor method, which initialises the operator and operand stacks
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 assembledcontext
- The local context for this lineevalBool
- 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