CoreFlatten.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Spreitzer, August 1, 1985 9:54:00 pm PDT
DIRECTORY Core, CoreRecordCells;
CoreFlatten: CEDAR DEFINITIONS = BEGIN OPEN Core, CoreRecordCells;
Introduction
This interface defines a utility for flattening the data structure defined in Core.
Flat Core
A flattened piece of Core is a hierarchy of instances. From each instance, a list of the instances below it can be reached via the children property. The actual internal wires can be reached via the internalWire property.
children: ATOM;
InstanceList: TYPE = LIST OF Instance;
internalWire: ATOM;
Flattening
Flatten: PROC [cellType: CellType, control: FlattenControl] RETURNS [root: Instance];
Control
Flattening can be carried out to an arbitrary depth. The decision of whether to expand or stop is made at each node in the hierarchy.
FlattenControl: TYPE = REF FlattenControlRec;
FlattenControlRec:
TYPE =
RECORD [
Decide: PROC [data: REF ANY, who: Who] RETURNS [ExpandDecision],
data: REF ANY];
ExpandDecision: TYPE = {leaf, expand};
Who:
TYPE =
LIST
OF Step;
Step from root is first in list.
Step: TYPE = RECORD [name: ROPE ← NIL, type: CellType];
Control by File
There is a yet-to-be-determined file format that allows a textual specification of flattening control.
ControlByFile: PROC [fileName: ROPE] RETURNS [control: FlattenControl];
END.