CoreRecastCacheImpl.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Christian LeCocq October 2, 1986 9:29:18 am PDT
Bertrand Serlet October 18, 1986 8:08:38 pm PDT
manages a Core recast cache, and keeps track of the bonding beetween publics.
DIRECTORY
Core,
CoreOps,
CoreProperties,
CoreRecastCache;
CoreRecastCacheImpl: CEDAR PROGRAM
IMPORTS
CoreOps,
CoreProperties
EXPORTS CoreRecastCache
~ BEGIN
Recast cache
ToBasic: PUBLIC PROC [cellType: Core.CellType] RETURNS [basic: Core.CellType] ~ {
Similar to CoreOps.ToBasic, but sticks the recasted cell of the original.
basic ← GetRecastedCell[cellType];
IF basic=NIL THEN {
FOR basic ← cellType, CoreOps.Recast[basic] UNTIL basic.class.recast = NIL DO NULL ENDLOOP;
PutRecastedCell[basic, cellType];
};
};
BackAnnotateWires: PUBLIC PROC [cellType: Core.CellType] ~ {
Copies the information from the public of the recasted to the public of the original.
basic: Core.CellType ← ToBasic[cellType];
IF cellType.public=basic.public THEN RETURN;
IF CoreOps.VisitBinding[cellType.public, basic.public, MergeWireProperties] THEN ERROR;
};
MergeWireProperties: CoreOps.EachWirePairProc = {
PROC [actualWire, publicWire: Wire]
AddToActual: PROC [prop: ATOM, val: REF] = {
CoreProperties.PutWireProp[actualWire, prop, val];
};
IF publicWire.size=0 THEN CoreProperties.Enumerate[publicWire.properties, AddToActual];
};
Properties management
GetRecastedCell: PROC [cellType: Core.CellType] RETURNS [basic: Core.CellType] ~ {
basic ← NARROW[CoreProperties.GetCellTypeProp[cellType, recastCacheProp]];
};
PutRecastedCell: PROC [cellType, basic: Core.CellType] ~ {
CoreProperties.PutCellTypeProp[cellType, recastCacheProp, basic];
};
recastCacheProp: ATOM = CoreProperties.RegisterProperty[
prop: $RecastCache,
properties: CoreProperties.Props[
[CoreProperties.propPrint, CoreProperties.PropDontPrint]
]
];
END.