Sequence.mesa 
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Barth, April 28, 1988 12:55:44 pm PDT
DIRECTORY Core, RefTab, Rope;
Sequence: CEDAR DEFINITIONS = BEGIN
Theory
Sequences describes the class of cellTypes made from a collection of cell instances of identical type bound together.
Types and Procedures
sequenceCellClass: Core.CellClass;
SequenceCellType: TYPE = REF SequenceCellTypeRec;
SequenceCellTypeRec: TYPE = RECORD [
base: Core.CellType,
count: NAT,
bindings: WireBindings ← NIL,
operations: Operations ← NIL];
FOR cell: NAT IN [0..count-1) DO
FOR wpl: WirePairs ← bindings, wpl.rest UNTIL wpl=NIL DO
bind CorrespondingActual[instances[cell+1].actual, base.public, wpl.first.this] to CorrespondingActual[instances[cell].actual, base.public, wpl.first.that]
ENDLOOP;
ENDLOOP;
WireBindings: TYPE = LIST OF WireBindRec;
WireBindRec: TYPE = RECORD [this, that: Core.Wire];
Operations: TYPE = RefTab.Ref;
Operation: TYPE = REF OperationRec;
OperationRec: TYPE = RECORD [
expose: ARRAY PublicWireType OF BOOLALL[FALSE]];
PublicWireType: TYPE = {sequence, flatSequence, common, first, last};
DecorateProc: TYPE = PROC [baseWire: Core.Wire, parentWires: ARRAY PublicWireType OF Core.Wire ← ALL[NIL]];
CreateSequence: PROC [base: Core.CellType, count: NAT, bindings: WireBindings ← NIL, operations: Operations ← NIL, name: Rope.ROPENIL, props: Core.Properties ← NIL, decorateProc: DecorateProc ← NIL] RETURNS [cellType: Core.CellType];
END.