All Packages  Class Hierarchy  This Package  Previous  Next  Index

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

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

public class Register
extends Object
The Register class is used to represent a register of the target architecture (MIPS). For now it is little more than the $whatever name of the register, but this class might well be evolved.

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


Constructor Index

 o Register(String)
The constructor that takes a single String argument expects it to be the name of the register, without the $.
 o Register(String, int)
The constructor which takes a prefix String and then an integer is for members of numbered families of registers, e.g.

Method Index

 o equals(Object)
The equals method is overriden such that Registers are equal if their names are equal
 o hashCode()
The hashCode method is overriden to reflect the name-based equality.
 o toString()
The toString conversion (which is automatically invoked if a Regiser is added to a String) provides the name, inclusive of the $.

Constructors

 o Register
 public Register(String n)
The constructor that takes a single String argument expects it to be the name of the register, without the $.

 o Register
 public Register(String prefix,
                 int num)
The constructor which takes a prefix String and then an integer is for members of numbered families of registers, e.g. one could do new Register("t", 0) to create $t0.

Methods

 o toString
 public String toString()
The toString conversion (which is automatically invoked if a Regiser is added to a String) provides the name, inclusive of the $.

Overrides:
toString in class Object
 o equals
 public boolean equals(Object other)
The equals method is overriden such that Registers are equal if their names are equal

Overrides:
equals in class Object
 o hashCode
 public int hashCode()
The hashCode method is overriden to reflect the name-based equality.

Overrides:
hashCode in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index