avrora.syntax
Interface Context

All Known Implementing Classes:
Module

public interface Context

The Context interface represents a context in which an expression in a program should be evaluated. It provides the environmental bindings necessary to resolve variable references within computed expressions.


Method Summary
 Register getRegister(AbstractToken ident)
          The getRegister() method resolves a register that may have been renamed earlier in the program.
 int getVariable(AbstractToken ident)
          The getVariable() method looks up the value of a named constant within the current environment and returns its value.
 

Method Detail

getRegister

public Register getRegister(AbstractToken ident)
The getRegister() method resolves a register that may have been renamed earlier in the program.

Parameters:
ident - the string name of the register or register alias
Returns:
a reference to the Register instance representing the register with the specified name or alias

getVariable

public int getVariable(AbstractToken ident)
The getVariable() method looks up the value of a named constant within the current environment and returns its value.

Parameters:
ident - the name of the variable
Returns:
the value of the variable within the environment