CoreOps.mesa 
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, October 2, 1985 11:39:31 am PDT
Bertrand Serlet August 14, 1985 10:58:16 am PDT
Spreitzer, August 12, 1985 5:18:13 pm PDT
DIRECTORY Core;
CoreOps: CEDAR DEFINITIONS = BEGIN OPEN Core;
Theory
This interface defines interesting utilities for the data structure defined in Core.
Designs
CreateDesign: PROC [name: ROPENIL, props: Properties ← NIL] RETURNS [design: Design];
PrintDesign: PROC [design: Design, out: STREAM];
May raise StructureError[MissingParameter]. Looks for printClassProcProp in the cell type class's properties.
printClassProcProp: ATOM;
PrintClassProc: TYPE = PROC [data: REF ANY, out: STREAM];
Cell Classes
RegisterCellClass: PROC [class: CellClass];
May raise StructureError[DuplicateName, MissingParameter]. Resuming when DuplicateName is OK.
Cell Types
InsertCellType: PROC [design: Design, cellType: CellType];
Inserts the cellType into the directory of the design. Raises StructureError[MissingParameter] if the name, class, design or cellType is NIL. Raises StructureError[DuplicateName] if a cellType of that name already exists. Resuming when DuplicateName is OK.
FetchCellType: PROC [design: Design, name: ROPE] RETURNS [cellType: CellType];
May raise StructureError[MissingParameter]. Returns NIL if no such named cellType.
EnumerateCellTypes: PROC [design: Design, action: EachEntryAction] RETURNS [quit: BOOL];
May raise StructureError[MissingParameter].
EachEntryAction: TYPE = PROC [cellType: CellType] RETURNS [quit: BOOLFALSE];
PrintCellType: PROC [cellType: CellType, out: STREAM];
Identity: PROC [cellType: CellType, name: ROPE, props: Properties ← NIL] RETURNS [identity: CellType];
Returns a CellType which refers to the original CellType but has a new property list. Useful when properties describe instances of a class all of whose members have the same Core data structure.
Recast: RecastProc;
Always returns the same pointer, given same cell type.
Wires
CreateSequenceWire: PROC [name: ROPENIL, components: LIST OF Wire, props: Properties ← NIL] RETURNS [wire: Wire];
CreateRecordWire: PROC [name: ROPENIL, components: LIST OF Wire, props: Properties ← NIL] RETURNS [wire: Wire];
CreateAtomWire: PROC [name: ROPENIL, props: Properties ← NIL] RETURNS [wire: Wire];
CopyWire: PROC [wire: Wire] RETURNS [new: Wire];
VisitWire: PROC [wire: Wire, eachWire: EachWireProc];
EachWireProc: TYPE = PROC [wire: Wire] RETURNS [notSubWires: BOOLFALSE, quit: BOOLFALSE];
PrintWire: PROC [wire: Wire, out: STREAM];
PrintIndent: PROC [depth: NAT, out: STREAM];
NameWire: PROC [wire: Wire, name: ROPE, prop: ATOM];
Attaches full path names to wire tree starting with initial name "name" on wire "wire" using property "prop". For each recursive call appends .(wire.elements[i].name) if structure = record or [index] if structure = sequence.
NameAllWires: PROC [design: Design];
Names all the public wires in a design using publicWireFullName as the property atom. Looks for nameClassWireProcProp, whose value must be a NameWireProc, in each cell type class's properties.
NameWireProc: TYPE = PROC [data: REF ANY];
nameClassWireProcProp: ATOM;
publicWireFullName: ATOM;
END.