RoseRecognizeTransistorsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Barth, September 5, 1985 6:40:39 pm PDT
Spreitzer, November 18, 1985 9:56:57 pm PST
DIRECTORY Core, CoreOps, CoreProperties, CoreClasses, RoseBind, RoseRecognizeTransistors;
RoseRecognizeTransistorsImpl:
CEDAR
PROGRAM
IMPORTS CoreOps, CoreProperties, CoreClasses, RoseBind
EXPORTS RoseRecognizeTransistors
=
BEGIN
transistorBC: RoseBind.BehaviorClass;
Recognize:
PUBLIC
PROC [ct: Core.CellType]
RETURNS [bc: RoseBind.BehaviorClass] = {
bc ← NIL;
IF ct.class = CoreClasses.transistorCellClass
THEN {
bc ← transistorBC;
IF CoreProperties.GetCellTypeProp[ct, RoseBind.argsKey] =
NIL
THEN CoreProperties.PutCellTypeProp[ct, RoseBind.argsKey, ct.data];
};
};
Start:
PROC = {
pw: Core.Wire = CoreOps.CreateRecordWire[
LIST[
CoreOps.CreateAtomWire["gate"],
CoreOps.CreateAtomWire["ch1"],
CoreOps.CreateAtomWire["ch2"]
],
"TransistorPublic",
CoreProperties.Props[[RoseBind.switchWire, $T]]
];
transistorBC ← RoseBind.EnsureBehaviorClass["Transistor", pw];
};
Start[];
END.