avrora.syntax
Class SyntacticOperand.Expr

java.lang.Object
  extended byavrora.syntax.ASTNode
      extended byavrora.syntax.SyntacticOperand
          extended byavrora.syntax.SyntacticOperand.Expr
All Implemented Interfaces:
Operand, Operand.Constant
Enclosing class:
SyntacticOperand

public static class SyntacticOperand.Expr
extends SyntacticOperand
implements Operand.Constant

The SyntacticOperand.Expr class represents a constant expression that was specified in the source assembly as an expression. This expression might be compound and need to be evaluated before its actual value is known.


Nested Class Summary
 
Nested classes inherited from class avrora.syntax.SyntacticOperand
SyntacticOperand.Expr, SyntacticOperand.Register
 
Nested classes inherited from class avrora.core.Operand
Operand.Constant, Operand.Register
 
Field Summary
 Expr expr
           
 
Fields inherited from class avrora.syntax.SyntacticOperand
left, right
 
Constructor Summary
SyntacticOperand.Expr(Expr e, boolean b)
           
 
Method Summary
 Operand.Constant asConstant()
          The asConstant() method uses virtual dispatch to avoid a cast.
 int getValue()
           
 int getValueAsWord()
           
 void simplify(int nextByteAddress, Context c)
           
 java.lang.String toString()
           
 
Methods inherited from class avrora.syntax.SyntacticOperand
asRegister, getLeftMostToken, getRightMostToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface avrora.core.Operand
asRegister
 

Field Detail

expr

public final Expr expr
Constructor Detail

SyntacticOperand.Expr

public SyntacticOperand.Expr(Expr e,
                             boolean b)
Method Detail

asConstant

public Operand.Constant asConstant()
Description copied from interface: Operand
The asConstant() method uses virtual dispatch to avoid a cast. If this operand is an instance of Operand.Constant it will return itself. Otherwise, it will return null.

Specified by:
asConstant in interface Operand
Overrides:
asConstant in class SyntacticOperand

getValue

public int getValue()
Specified by:
getValue in interface Operand.Constant

getValueAsWord

public int getValueAsWord()
Specified by:
getValueAsWord in interface Operand.Constant

simplify

public void simplify(int nextByteAddress,
                     Context c)
Specified by:
simplify in class SyntacticOperand

toString

public java.lang.String toString()