Produce Modula-3 code for the stable object's
implementation. The exception StablegenError.E is raised if
some error in the users data structures is uncoverd. In general, this
should not occur at this point.
INTERFACEGenModuleCode ; IMPORT Formatter, ImportList, StablegenError, Type; PROCEDURE Header (modWr : Formatter.T; implName : TEXT; methods : ImportList.MethodList; importList: ImportList.T );
Produce a module (with nameimplName) header together with theIMPORTstatements (produced out ofimportList. After that a declaration of an enumeration type is added. It enumerates all update methods (using the listmethods). Code is written tomodWr.
PROCEDURE Revealation (modWr : Formatter.T;
repName: TEXT;
methods: ImportList.MethodList)
RAISES {StablegenError.E};
Produce the code for the revealation of the generic typeStable.T. Code is written tomodWr,repNameis the filename of the instatiation of the generic part of the implementation,methodsis a list of its update methods
PROCEDURE Surrogates (modWr : Formatter.T;
name : Type.Qid;
repName: TEXT;
methods: ImportList.MethodList)
RAISES {StablegenError.E};
Produce the code of the methods that log their parameters. Code is written tomodWr,nameis the object's name for which a stable implementation is produced,repNameis the name of the instantiated generic part of the generated code,methodsis a list of its update methods
PROCEDURE Dispatcher (modWr : Formatter.T;
methods: ImportList.MethodList)
RAISES {StablegenError.E};
Produce code for procedure which reads the log and starts all the redo stubs. Code is written tomodWr,methodsis a list of its update methods
PROCEDURE ReplayStubs (modWr : Formatter.T;
name : Type.Qid;
methods: ImportList.MethodList)
RAISES {StablegenError.E};
Produce code for the redo stubs. AgainmodWris the writer that takes the code,typeis the object andmethodsis the list of the update methods
PROCEDURE Checkpoint(modWr: Formatter.T; repName: TEXT);
Generate the call to the procedure that does the checkpoint (which
is in the generic part of the implementation of stable objects repName) END GenModuleCode.