IntCodeGen.mesa
Copyright Ó 1988, 1991 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) December 12, 1988 10:46:44 pm PST
DIRECTORY
CardTab USING [Ref],
IntCodeDefs USING [Node],
Rope USING [ROPE];
IntCodeGen: CEDAR DEFINITIONS = BEGIN
CodeGenerator: TYPE = PROC [
fileName: Rope.ROPE,
moduleName: Rope.ROPE,
versionStamp: Rope.ROPE,
root: IntCodeDefs.Node,
names: CardTab.Ref,
labels: CardTab.Ref,
data: REF,
switches: PACKED ARRAY CHAR['a..'z] OF BOOL
]
RETURNS [msg: Rope.ROPE ¬ NIL];
The type for the code generator interception procedure.
fileName gives the file name (without directory or extension).
moduleName gives the module name.
root gives the root of the code graph.
names provides a way to lookup label names for named variables.
labels provides a way to lookup label names for procedures.
data gives the callback data as passed to RegisterCodeGenerator.
switches gives the callback data as passed to RegisterCodeGenerator.
The return value provides an error message (NIL if no errors).
RegisterCodeGenerator: PROC [cg: CodeGenerator, data: REF];
Registers the given code generator for callback when the front end has something to generate code for. cg = NIL removes the registration. New registrations simply overwrite the old.
GetCodeGenerator: PROC RETURNS [cg: CodeGenerator, data: REF];
Returns the current registration.
END.