Previous    Next


Implement the rest of the Frame module, which contains all the machine-dependent parts of the compiler: register sets, calling sequences, and activation record (frame) layout. Program 12.1 shows the Frame class. Most of this interface has been described elsewhere. What remains is

Package Frame.
package Frame;
import Temp.Temp;
public abstract class Frame implements Temp.TempMap {
abstract public Temp RV(); (see p. 157)
abstract public Temp FP(); (p. 143)
abstract public Temp.TempList registers();
abstract public String tempMap(Temp temp);
abstract public int wordSize(); (p. 143)
abstract public Tree.Exp externalCall(String func,Tree.ExpList args); (p. 153)
abstract public Frame newFrame(Temp.Label name,
 Util.BoolList formals); (p. 127)
public AccessList formals; (p. 128)
public Temp.Label name; (p. 127)
abstract public Access allocLocal(boolean escape); (p. 129)
abstract public Tree.Stm procEntryExit1(Tree.Stm body); (p. 251)
abstract public Assem.InstrList procEntryExit2(Assem.InstrList body); (p. 199)
abstract public Proc procEntryExit3(Assem.InstrList body);
abstract public Assem.InstrList codegen(Tree.Stm stm); (p. 196)

Java End example

JaVaScreenshot Previous    Next