TestSisyph.mesa
Copyright © 1985 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 June 1, 1986 3:09:14 pm PDT
Barth, January 13, 1986 3:30:54 pm PST
DIRECTORY
CD, CDDirectory, CDRects, CDSatellites, CDCells,
Core, CoreClasses, CoreOps,
IO,
PW,
Rope,
Sinix,
Sisyph,
TerminalIO;
TestSisyph:
CEDAR
PROGRAM
IMPORTS CDDirectory, CoreClasses, CoreOps, PW, Sinix, Sisyph, TerminalIO = BEGIN
CellType: TYPE = Core.CellType;
Wire: TYPE = Core.Wire;
Object: TYPE = CD.Object;
ROPE: TYPE = Core.ROPE;
Context: TYPE = Sisyph.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]];
};
TestCx:
PROC [] =
BEGIN
design: CD.Design ← PW.OpenDesign["ExtractExample"];
targetObj: CD.Object ← CDDirectory.Fetch[design, "nD"].object;
cx: Context ← Sisyph.Create[design];
result: REF ← Sinix.Extract[obj: targetObj, mode: Sisyph.sisyphMode, userData: cx].result;
CoreOps.Print[result, TerminalIO.TOS[]];
ERROR;
END;
Test:
PROC [] =
BEGIN
design: CD.Design ← PW.OpenDesign["TestSisyph"];
targetObj: CD.Object ← CDDirectory.Fetch[design, "TestCell"].object;
cx: Context ← Sisyph.Create[design];
result: REF ← Sinix.Extract[obj: targetObj, mode: Sisyph.sisyphMode, userData: cx].result;
CoreOps.Print[result, TerminalIO.TOS[]];
END;
END.