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 theIMPORT
statements (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
,repName
is the filename of the instatiation of the generic part of the implementation,methods
is 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
,name
is the object's name for which a stable implementation is produced,repName
is the name of the instantiated generic part of the generated code,methods
is 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
,methods
is 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. AgainmodWr
is the writer that takes the code,type
is the object andmethods
is 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.