avrora.syntax
Class SyntacticOperand.Expr
java.lang.Object
avrora.syntax.ASTNode
avrora.syntax.SyntacticOperand
avrora.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.
Method Summary |
Operand.Constant |
asConstant()
The asConstant() method uses virtual dispatch to avoid a cast. |
int |
getValue()
The getvalue() method returns the integer value of this constant operand. |
int |
getValueAsWord()
The getValueAsWord() method returns the value of this constant operand as
word-aligned; meaning, for addresses, it will divide by 2, but for immediate constants
it will not. |
void |
simplify(int nextByteAddress,
Context c)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
expr
public final Expr expr
SyntacticOperand.Expr
public SyntacticOperand.Expr(Expr e,
boolean b)
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()
- Description copied from interface:
Operand.Constant
- The
getvalue()
method returns the integer value of this constant operand.
- Specified by:
getValue
in interface Operand.Constant
- Returns:
- an integer representation of the value
getValueAsWord
public int getValueAsWord()
- Description copied from interface:
Operand.Constant
- The
getValueAsWord()
method returns the value of this constant operand as
word-aligned; meaning, for addresses, it will divide by 2, but for immediate constants
it will not.
- Specified by:
getValueAsWord
in interface Operand.Constant
- Returns:
- an integer representation of the value, word-aligned if it is an address
simplify
public void simplify(int nextByteAddress,
Context c)
- Specified by:
simplify
in class SyntacticOperand
toString
public java.lang.String toString()