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
Designs
CreateDesign:
PROC [name:
ROPE ←
NIL, 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 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: BOOL ← FALSE];
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:
ROPE ←
NIL, components:
LIST
OF Wire, props: Properties ←
NIL]
RETURNS [wire: Wire];
CreateRecordWire:
PROC [name:
ROPE ←
NIL, components:
LIST
OF Wire, props: Properties ←
NIL]
RETURNS [wire: Wire];
CreateAtomWire:
PROC [name:
ROPE ←
NIL, 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: BOOL ← FALSE, quit: BOOL ← FALSE];
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;