SCMakeInterfaceImpl.mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Created by: Jacobi, July 11, 1986 10:45:18 am PDT
Last Edited by: Jacobi July 11, 1986 11:16:32 am PDT
DIRECTORY
CD, CDDirectory, CDProperties, Core, CoreClasses, CoreCreate, CoreOps, IO, Rope, SCLibGen;
SCMakeInterfaceImpl:
CEDAR
PROGRAM
IMPORTS CDDirectory, CDProperties, CoreClasses, CoreCreate, CoreOps, IO, SCLibGen =
BEGIN
CellTypeFromRope:
PROC [r: Rope.
ROPE]
RETURNS [ct: Core.CellType] = {
stream: IO.STREAM ← IO.RIS[r];
wrs: LIST OF CoreCreate.WR ← NIL;
end: LIST OF CoreCreate.WR ← NIL;
wire: Core.Wire;
WHILE
NOT
IO.EndOf[stream]
DO
token: Rope.ROPE ← IO.GetTokenRope[stream].token;
piece: LIST OF CoreCreate.WR ← LIST[token];
IF wrs=NIL THEN wrs ← piece ELSE end.rest ← piece;
end ← piece;
ENDLOOP;
wire ← CoreCreate.WireList[wrs];
ct ← CoreClasses.CreateUnspecified[public: wire];
};
MakeIF:
PROC [ob:
CD.Object] = {
WITH CDProperties.GetProp[ob, $PinOrder]
SELECT
FROM
r: Rope.
ROPE => {
ct: Core.CellType ← CellTypeFromRope[r];
[] ← CoreOps.SetCellTypeName[ct, CDDirectory.Name[ob]];
CDProperties.PutProp[ob, $Interface, ct];
}
ENDCASE => NULL;
};
SCLibGen.SeeMe[MakeIF];
END.