All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.gac.max.mcs388.s2001.compiler_support.RegisterAllocator

java.lang.Object
   |
   +----edu.gac.max.mcs388.s2001.compiler_support.RegisterAllocator

public class RegisterAllocator
extends Object
The Register class is used to represent a pool from which Registers can be allocated and to which they can then later be deallocated. Some to-do items:

Written 7 Feb 1997 by Max Hailperin <max@gac.edu>


Constructor Index

 o RegisterAllocator(String, int)
The RegisterAllocator constructor takes a String prefix argument that is used for constructing each Register.

Method Index

 o allocate()
 o deallocate(Register)
 o deallocateIfYours(Register)

Constructors

 o RegisterAllocator
 public RegisterAllocator(String prefix,
                          int number)
The RegisterAllocator constructor takes a String prefix argument that is used for constructing each Register. It also takes an int number argument, which specifies how many registers there will be. They are numbered consectively from 0. For example, new RegisterAllocator("t", 10) will allocate registers $t0 through $t9.

Methods

 o allocate
 public Register allocate()
 o deallocate
 public void deallocate(Register r) throws NotMyRegisterException
 o deallocateIfYours
 public void deallocateIfYours(Register r)

All Packages  Class Hierarchy  This Package  Previous  Next  Index