package IRT;
import Frame.Access;

/**
 * Information about accessing variables in a register,
 * computed during the Tiger compilation process.  
 * <p>
 * <strong>History</strong>
 * <dl>
 * <dt>8 December 1998 (version 0.1)
 * <dt>16 December 1998 (version 0.2)
 * <dd>Added constructor.
 * <dd>Added <code>exp</code> method.
 * </dl>
 *
 * @author Samuel A. Rebelsky
 * @author Andrew Appel
 * @version 0.2 of 16 December 1998
 */
public class InReg extends Access {
  // +--------+--------------------------------------------------
  // | Fields |
  // +--------+

  /**
   * The temporary used for the current register.
   */
  Temp.Temp temp;


  // +-----------------------------------------------------------
  // | Constructors |
  // +--------------+

  /**
   * Create a new register access.
   */
  public InReg() {
    temp = new Temp.Temp();
  } // InReg()


  // +---------+-------------------------------------------------
  // | Methods |
  // +---------+

  /**
   * Build the tree expression used to get a register.  In this
   * case, returns the temporary and ignores the frame.
   */
  public Tree.Exp exp(Tree.Exp framePtr) {
    return new Tree.TEMP(temp);
  } // exp(Tree.Exp)

} // class InReg
