C2CMain.mesa
Copyright Ó 1987, 1988, 1990, 1991 by Xerox Corporation. All rights reserved.
Christian Jacobi, May 11, 1988 2:53:59 pm PDT
Christian Jacobi, October 11, 1990 9:50:50 am PDT
DIRECTORY
C2CDefs,
IntCodeDefs,
Rope;
C2CMain: CEDAR DEFINITIONS =
Code: TYPE = C2CDefs.Code;
CodeCont: TYPE = C2CDefs.CodeCont;
C2CRoot:
PROC []
RETURNS [code: Code];
--expects state to be already created, indentifiers to be read
GenNode:
PROC [node: IntCodeDefs.Node, mode: C2CDefs.Mode]
RETURNS [cc: CodeCont];
GenApplyNode: PROC [applyNode: IntCodeDefs.ApplyNode, mode: C2CDefs.Mode] RETURNS [cc: CodeCont];
GenAssignNode: PROC [assignNode: IntCodeDefs.AssignNode, mode: C2CDefs.Mode] RETURNS [cc: CodeCont];
GenVarNode:
PROC [varNode: IntCodeDefs.Var, mode: C2CDefs.Mode]
RETURNS [cc: CodeCont];
--usage of variable; not declaration
GenConstNode: PROC [constNode: IntCodeDefs.ConstNode, mode: C2CDefs.Mode] RETURNS [cc: CodeCont];
GenNodeNCast:
PROC [node: IntCodeDefs.Node, class: IntCodeDefs.ArithClass]
RETURNS [cc: CodeCont];
GenHandlerNode:
PROC [handler: IntCodeDefs.Handler, mode: C2CDefs.Mode, innerIsLive:
BOOL ¬
TRUE]
RETURNS [sc, preCode, postCode: C2CDefs.Code];
--innerIsLive: in doubt set to TRUE
HandleCompositeLoc:
PROC [varNode: IntCodeDefs.Var, mode: C2CDefs.Mode, compositeLoc: IntCodeDefs.CompositeLocation, hackAddr: Rope.
ROPE¬NIL]
RETURNS [cc: CodeCont];
--hackAddr: efficiency hack;
-- if present composite location is generated into *hackAddr
-- required mode must be skip
-- hackAddr may be evaluated multiple times
GenAllOp: PROC [xApp: IntCodeDefs.ApplyNode, mode: C2CDefs.Mode] RETURNS [cc: CodeCont];
MakeOrFindRHSDummy:
PROC [bits:
INT]
RETURNS [name: Rope.
ROPE];
--reuses a dummy if it is large enough...
END.