CoreProperties.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Barth, January 28, 1986 2:47:58 pm PST
Spreitzer, August 12, 1985 6:05:07 pm PDT
Bertrand Serlet May 29, 1986 6:25:49 pm PDT
Pradeep Sindhu February 7, 1986 4:00:28 pm PST
Operations
GetProp:
PROC [from: Properties, prop:
ATOM]
RETURNS [value:
REF
ANY ←
NIL];
If value is NIL then no such property.
PutProp:
PROC [on: Properties, prop:
ATOM, value:
REF
ANY ←
NIL]
RETURNS [new: Properties];
If value is NIL then the property is deleted.
CopyProps:
PROC [propList: Properties]
RETURNS [copy: Properties];
Uses the property's property propCopy to copy each item.
AppendProps:
PROC [winner, loser: Properties]
RETURNS [copy: Properties];
Uses the property's property propCopy to copy each item.
Enumerate:
PROC [props: Properties, consume:
PROC [prop:
ATOM, val:
REF
ANY ←
NIL]];
PrintProperties:
PROC [props: Properties, out:
STREAM ←
NIL, indent:
NAT ← 0, cr:
BOOL ←
TRUE, level:
NAT ← 2];
Uses the property's propPrettyPrint property to print each item.
Registration
RegisterProperty:
PROC [prop:
ATOM, properties: Properties ←
NIL]
RETURNS [sameProp:
ATOM];
Should be called by every tool which uses a property. Sets the property's properties as given in the second argument. Returns the argument so that definition and registration can occur in the same line of Cedar code.
StoreProperties:
PROC [prop:
ATOM, properties: Properties];
Store a property on a property.
FetchProperties:
PROC [prop:
ATOM]
RETURNS [properties: Properties];
Fetch a property from a property.
propPrint, propCopy, propCompare: ATOM;
Values should be REFs to procs of the appropriate TYPEs.
No PropCompareProc means pointer comparison.
No PropCopyProc means don't copy the property.
PropCompareProc: TYPE = PROC [prop: ATOM, value1, value2: REF ANY] RETURNS [equal: BOOL ← FALSE];
PropCopyProc:
TYPE =
PROC [prop:
ATOM, value:
REF
ANY]
RETURNS [valCopy:
REF
ANY];
If valCopy is NIL then don't copy.
PropPrintProc:
TYPE =
PROC [to:
STREAM, prop:
ATOM, val:
REF
ANY, indent:
NAT, level:
NAT];
PropDoCopy: REF PropCopyProc; -- Copy of the value; trivial procedure;
PropDontPrint: REF PropPrintProc; -- Does not print anything
PropRopeCompare: REF PropCompareProc;
PropIntCompare: REF PropCompareProc;
Short Cuts
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];