TestPipalSisyph.mesa
Copyright Ó 1985, 1986, 1987, 1988 by Xerox Corporation. All rights reserved.
Created by Pradeep Sindhu, November 26, 1985 3:06:31 pm PST
Pradeep Sindhu February 19, 1986 1:11:20 am PST
Bertrand Serlet March 5, 1988 7:13:31 pm PST
Barth, January 13, 1986 3:30:54 pm PST
DIRECTORY
CD, CDDirectory, CDRects, CDSatellites, CDCells,
Core, CoreClasses, CoreOps,
IO,
PipalSinix, PipalSisyph,
PW,
Rope, TerminalIO;
TestPipalSisyph: CEDAR PROGRAM
IMPORTS CDDirectory, CoreClasses, CoreOps, PipalSinix, PipalSisyph, PW, TerminalIO = BEGIN
CellType: TYPE = Core.CellType;
Wire: TYPE = Core.Wire;
Object: TYPE = CD.Object;
ROPE: TYPE = Core.ROPE;
Context: TYPE = PipalSisyph.Context;
StructWire: PROC [name: ROPE, n: INT] RETURNS [Wire] = {
subWires: LIST OF Wire ← NIL;
WHILE n > 0 DO subWires ← CONS[CoreOps.CreateWire[], subWires]; n ← n-1; ENDLOOP;
RETURN [CoreOps.CreateWire[elements: subWires, name: name]]
};
TreeCellCode: PROC [] RETURNS [CellType] = {
wire: Wire ← StructWire["father", 3];
RETURN [CoreClasses.CreateRecordCell[CoreOps.CreateWire[elements: LIST[wire]], CoreOps.CreateWire[elements: LIST[wire]], NIL]];
};
TestWireIcon: PROC [] RETURNS [wire: Wire] = {
wire ← CoreOps.CreateWires[size: 3, name: "BigStruct"];
wire[0] ← CoreOps.CreateWire[name: "Zero"];
wire[1] ← CoreOps.CreateWire[name: "One"];
wire[2] ← CoreOps.CreateWires[size: 2, name: "SmallStruct"];
wire[2][0] ← CoreOps.CreateWire[name: "Zero"];
wire[2][1] ← CoreOps.CreateWire[name: "TwoOne"];
};
FooBarWireIcon: PROC [] RETURNS [wires: Core.Wires] = {
wires ← LIST [CoreOps.CreateWire[name: "foo"], CoreOps.CreateWire[name: "bar"]];
};
TestCx: PROC [] = BEGIN
design: CD.Design ← PW.OpenDesign["ExtractExample"];
targetObj: CD.Object ← CDDirectory.Fetch[design, "nD"].object;
cx: Context ← PipalSisyph.Create[design];
result: REF ← PipalSinix.Extract[obj: targetObj, mode: PipalSisyph.mode, userData: cx].result;
CoreOps.Print[result, TerminalIO.TOS[]];
ERROR;
END;
Test: PROC [] = BEGIN
design: CD.Design ← PW.OpenDesign["TestPipalSisyph"];
targetObj: CD.Object ← CDDirectory.Fetch[design, "TestCell"].object;
cx: Context ← PipalSisyph.Create[design];
result: REF ← PipalSinix.Extract[obj: targetObj, mode: PipalSisyph.mode, userData: cx].result;
CoreOps.Print[result, TerminalIO.TOS[]];
END;
END.