DIRECTORY Core, CoreClasses; CoreProperties: CEDAR DEFINITIONS = BEGIN OPEN Core; GetProp: PROC [from: Properties, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PutProp: PROC [on: Properties, prop: ATOM, value: REF ANY _ NIL] RETURNS [new: Properties]; Enumerate: PROC [props: Properties, consume: PROC [ATOM, REF ANY]]; PrintProperties: PROC [props: Properties, out: STREAM _ NIL, indent: NAT _ 0, cr: BOOL _ TRUE, level: NAT _ 2]; GetPropPrintProc: PROC [prop: ATOM, val: REF ANY] RETURNS [PropPrintProc]; RegisterProperty: PROC [prop: ATOM, properties: Properties _ NIL] RETURNS [sameProp: ATOM]; RegisterUnprintableProperty: PROC [prop: ATOM, properties: Properties _ NIL] RETURNS [sameProp: ATOM]; StoreProperties: PROC [prop: ATOM, properties: Properties]; FetchProperties: PROC [prop: ATOM] RETURNS [properties: Properties]; propPrint: ATOM; PropPrintProc: TYPE = PROC [to: STREAM, prop: ATOM, val: REF ANY, indent, level: NAT, cr: BOOL]; PropDontPrint: REF PropPrintProc; -- Does not print anything InheritCellTypeProp: PROC [from: CellType, prop: ATOM] RETURNS [value: REF ANY _ NIL]; InheritPublicProp: PROC [cellType: CellType, from: Wire, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PropertyLiteral: TYPE = RECORD [key: ATOM, val: REF ANY _ NIL]; Props: PROC [lit1, lit2, lit3, lit4, lit5, lit6: PropertyLiteral _ []] RETURNS [properties: Properties]; GetWireProp: PROC [from: Wire, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PutWireProp: PROC [on: Wire, prop: ATOM, value: REF ANY _ NIL]; GetCellClassProp: PROC [from: CellClass, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PutCellClassProp: PROC [on: CellClass, prop: ATOM, value: REF ANY _ NIL]; GetCellTypeProp: PROC [from: CellType, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PutCellTypeProp: PROC [on: CellType, prop: ATOM, value: REF ANY _ NIL]; GetCellInstanceProp: PROC [from: CoreClasses.CellInstance, prop: ATOM] RETURNS [value: REF ANY _ NIL]; PutCellInstanceProp: PROC [on: CoreClasses.CellInstance, prop: ATOM, value: REF ANY _ NIL]; END. @CoreProperties.mesa Copyright c 1985 by Xerox Corporation. All rights reversed. Barth, September 29, 1986 2:45:02 pm PDT Spreitzer, August 12, 1985 6:05:07 pm PDT Bertrand Serlet October 18, 1986 8:46:03 pm PDT Pradeep Sindhu February 7, 1986 4:00:28 pm PST Mike Spreitzer March 6, 1987 1:50:49 pm PST Theory This interface deals with properties. Property access is not synchronized by the implementation of this interface. Operations If value is NIL then no such property. If value is NIL then the property is deleted. consume is called with each (prop, value) pair. Uses the property's propPrint property to print each item. If no propPrint property exists and the value is of a well-known type, will print appropriately for that type. Returns the procedure that would be used to print the given property-value pair. Registration Should be called by every tool that defines a property which needs property's properties. Sets the property's properties as given in the second argument. Returns the same prop so that definition and registration can occur in the same line of Cedar code. Purely convenience; shorthand for RegisterProperty[prop, PutProp[properties, propPrint, PropDontPrint]] Store a property list on a property. Fetch the property list of a property. Value should be REF to PropPrintProc. Inheritance of Properties This is the proper way to get a property from a cell type for props that use inheritance. It takes into account the two standard Core property propagation mechanisms: one is from cell class to cell type, and the other is through cell types whose class has layersProps TRUE. Looks for a property with key prop on from, and, if none, looks on the class of from. If not found and cellType.class.layersProps then the celltype is recasted and the process repeated. This is the proper way to get a property from a public sub-wire for props that use inheritance. It takes into account the standard Core property propagation mechanisms. Looks for a property with key prop on from. If cellType.class.layersProps then the wire corresponding to from in the public of Recast[cellType] is searched for prop. This process is repeated until the search succeeds or the result of the recast has a class in which layersProps is FALSE. Short Cuts The following get & put procs are equivalent to directly manipulating the properties fields of various data types. Thus, they are not always appropriate, since Core defines some more complex property propagation mechanisms. Not always appropriate for getting properties from public wires --- see InheritPublicProp above. When a property might be placed on a public of a celltype which is the result of the recast of a celltype whose class has layersProps FALSE then the property should be placed on the nonrecasted celltype's public, in addition to or in instead of placement upon the recasted cell type's public. This allows the property inheritance mechanism to work correctly. Not always appropriate for getting properties from public wires --- see InheritCellTypeProp above. When a property might be placed on a celltype which is the result of the recast of a celltype whose class has layersProps FALSE then the property should be placed on the nonrecasted celltype, in addition to or in instead of placement upon the recasted cell type. This allows the property inheritance mechanism to work correctly. Ê>˜– "Cedar" stylešœ™Jšœ Ïmœ1™