Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## avrora.syntax
Class Expr.Variable

    java.lang.Object
      avrora.syntax.ASTNode
          avrora.syntax.Expr
              avrora.syntax.Expr.Term
                  avrora.syntax.Expr.Variable

Enclosing class:
  Expr

public static class Expr.Variable
extends Expr.Term

The `Variable` class represents a variable reference within the program.

Nested Class Summary

Nested classes inherited from class avrora.syntax.Expr
`Expr.BinOp, Expr.CharLiteral, Expr.Constant, Expr.Func, Expr.RelativeAddress, Expr.StringLiteral, Expr.Term, Expr.UnOp, Expr.Variable`

Field Summary

Fields inherited from class avrora.syntax.Expr.Term
`token`

Constructor Summary
`Expr.Variable(AbstractToken n)`

Method Summary
`int` | `evaluate(int currentByteAddress, Context c)` The `evaluate()` method computes the value of the expression in this context and returns its value.

Methods inherited from class avrora.syntax.Expr.Term
`getLeftMostToken, getRightMostToken, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Expr.Variable

    public Expr.Variable(AbstractToken n)

Method Detail

### evaluate

    public int evaluate(int currentByteAddress,
                        Context c)

  The `evaluate()` method computes the value of the expression in this context and returns its value. This implementation works straightforwardly by looking up the variable in the context and returning its value.

  Specified by:
    `evaluate` in class `Expr`
  Parameters:
    `currentByteAddress` - the current byte address within the program
    `c` - the context in which to evaluate this expression
  Returns:
    the value of the expression as a 32-bit integer

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD