FILE: M2H.mesa
Modula-2 Code-Generator, Part 3
Last Edited by: Gutknecht, September 19, 1985 3:04:13 pm PDT
DIRECTORY
M2D USING [SET, ObjPtr, StrPtr, ProcPtr, ConstValue],
M2S USING [Symbol],
M2I USING [Relation];
M2H: CEDAR DEFINITIONS = BEGIN
ItemMode: TYPE = { typMd, procMd, codMd, varMd, conMd, linxMd, sinxMd, ladrMd, sadrMd, opnMd, regMd, stkMd, jmpMd };
ItemPtr: TYPE = REF Item;
Item: TYPE = RECORD
     [ mode: ItemMode ← stkMd,
     contxt: M2D.ProcPtr ←NIL,
     obj: M2D.ObjPtr ← NIL,
     typ: M2D.StrPtr ← NIL,
     val: M2D.ConstValue ← [Int [0]],
     lev: CARDINAL ← 0,
     off: CARDINAL ← 0,
     opr: CARDINAL ← 0,
     opt, opt2: [0..1] ← 0,
     reg, reg2: CARDINAL ← 0,
     expRegs: M2D.SETALL [FALSE],
     rel: M2I.Relation ← false,
     Fjmp, Tjmp: CARDINAL ← 0 ];
rngchk: BOOLEAN;
LoadAdr: PROC [x: ItemPtr];
LoadAdrStk: PROC [x: ItemPtr];
Load: PROC [x: ItemPtr];
LoadStk: PROC [x: ItemPtr];
GenFJ: PROC [loc: CARDINAL] RETURNS [Loc: CARDINAL];
GenCFJ: PROC [x: M2H.ItemPtr] RETURNS [loc: CARDINAL];
GenBJ: PROC [loc: CARDINAL];
GenCBJ: PROC [x: M2H.ItemPtr, loc: CARDINAL];
GenIn: PROC [x, y: ItemPtr];
GenNeg: PROC [x: ItemPtr];
GenNot: PROC [x: ItemPtr];
GenAnd: PROC [x: ItemPtr];
GenOr: PROC [x: ItemPtr];
GenOp: PROC [op: M2S.Symbol, x, y: ItemPtr];
END.