CDMoreCoreGeneratorsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, August 14, 1985 2:35:33 pm PDT
Last Edited by Christian Jacobi, October 4, 1985 4:44:52 pm PDT
CDMoreCoreGeneratorsImpl:
CEDAR
MONITOR
IMPORTS CDCore, CDUtil, CoreClasses, CoreProperties =
CDAbutGenerator: CDCore.CreateProc =
BEGIN
dir: CDUtil.Direction;
instL: LIST OF CDUtil.InstRec ← NIL;
reOrdered: CoreClasses.CellInstanceList;
name: Rope.ROPE ← coreCellType.name;
coreCellType ← RecastToRecord[coreCellType];
IF param=NIL THEN dir ← right ELSE dir ← ToDir[param.first];
--make a reordered copy of the Core instance list
FOR l: CoreClasses.CellInstanceList ←
NARROW[coreCellType.data, CoreClasses.RecordCellType].instances, l.rest
WHILE l#
NIL
DO
reOrdered ← CONS[l.first, reOrdered];
ENDLOOP;
--build a CDUtil instance list
FOR list: CoreClasses.CellInstanceList ← reOrdered, list.rest
WHILE list#
NIL
DO
inst: CDUtil.InstRec = [
ob: CDCore.CreateCDFromCore[coreDesign: coreDesign, coreCellType: list.first.type, cdDesign: cdDesign],
name: list.first.name,
orient: ToOrient[CoreProperties.GetProp[list.first.properties, $CDOrient]]
];
instL ← CONS[inst, instL];
ENDLOOP;
--build the resulting object
ob ← CDUtil.CreateSimpleCell[design: cdDesign, contents: instL, direction: dir, cellName: name]
END;