RiscAssemblerCGImpl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Generated by hederman.pa at July 15, 1987 4:53:06 pm PDT
using ThreeCasabaFour [1.2] of June 1, 1987 6:00:00 pm PDT
DIRECTORY
RiscAssemblerAGDef,
RiscAssemblerATDef,
ThreeC4Support,
RiscAssemblerCGDef USING[],
RiscAssemblerTokenDef;
RiscAssemblerCGImpl: CEDAR PROGRAM IMPORTS RiscAssemblerAGDef EXPORTS RiscAssemblerCGDef=
BEGIN
OPEN RiscAssemblerAGDef, RiscAssemblerATDef, ThreeC4Support, RiscAssemblerTokenDef;
RiscAssemblerCGLinkProc: PUBLIC PROC[prodLinkArray: SeeProdLinkArray, tknLinkArray: TokenLinkArray] =
BEGIN
prodLinkArray[0] ← Seegoal;
prodLinkArray[1] ← Seeprogramlist;
prodLinkArray[2] ← Seeliststatement;
prodLinkArray[3] ← Seelistdangle;
prodLinkArray[4] ← Seelistcons;
prodLinkArray[5] ← Seestatementlabel;
prodLinkArray[6] ← Seestatementop;
prodLinkArray[7] ← Seestatementoprand;
prodLinkArray[8] ← Seelabelid;
prodLinkArray[9] ← Seeopnoop;
prodLinkArray[10] ← Seeopgoto;
prodLinkArray[11] ← Seerandid;
END;
Seegoal:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
program: ProgramNode;
program ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[program, stack];
RETURN [stack]
END;
Seeprogramlist:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
list: ListNode;
list ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildProgramlistProdNode[position, length, list], stack];
RETURN [stack]
END;
Seeliststatement:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
statement: StatementNode;
statement ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildListstatementProdNode[position, length, statement], stack];
RETURN [stack]
END;
Seelistdangle:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
statement: StatementNode;
statement ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildListdangleProdNode[position, length, statement], stack];
RETURN [stack]
END;
Seelistcons:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
statement: StatementNode;
list: ListNode;
list ← NARROW[stack.first];
stack ← stack.rest;
statement ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildListconsProdNode[position, length, statement, list], stack];
RETURN [stack]
END;
Seestatementlabel:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
label: LabelNode;
statement: StatementNode;
statement ← NARROW[stack.first];
stack ← stack.rest;
label ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildStatementlabelProdNode[position, length, label, statement], stack];
RETURN [stack]
END;
Seestatementop:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
op: OpNode;
op ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildStatementopProdNode[position, length, op], stack];
RETURN [stack]
END;
Seestatementoprand:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
op: OpNode;
rand: RandNode;
rand ← NARROW[stack.first];
stack ← stack.rest;
op ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildStatementoprandProdNode[position, length, op, rand], stack];
RETURN [stack]
END;
Seelabelid:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
id: idNode;
id ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildLabelidProdNode[position, length, id], stack];
RETURN [stack]
END;
Seeopnoop:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
stack ← CONS[BuildOpnoopProdNode[position, length], stack];
RETURN [stack]
END;
Seeopgoto:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
stack ← CONS[BuildOpgotoProdNode[position, length], stack];
RETURN [stack]
END;
Seerandid:
PROC [nodes:
LIST
OF
REF
ANY, position:
INT, length:
INT]
RETURNS [LIST OF REF ANY] =
BEGIN
stack: LIST OF REF ANY ← nodes;
id: idNode;
id ← NARROW[stack.first];
stack ← stack.rest;
stack ← CONS[BuildRandidProdNode[position, length, id], stack];
RETURN [stack]
END;
END..