Association of properties to definitions
This module specifies a set of useful generic PDL patterns.
If such patterns are associated to a property specification
PDL generates additional access functions for that property.
For example the PDL property specification
Size: int [SetGet, SetDiff];
allows to set the Size property using the functions
SetGetSize and SetDiffSize besides the basic
access functions provided by PDL.
The module does not have generic parameters.
It is used by writing
$/Prop/PropLib.fw
in a .specs file.
It provides the following PDL patterns:
SetGet :
The SetGet functions have same effect as the basic Set
function. But the value which is set is also returned as result of the call.
SetOnce :
The SetOnce functions have one value argument like the Reset
functions. The given value is only set if that property is not yet set.
The current value of the property is returned as result of the call.
KReset :
The KReset functions have same effect as the basic
Reset functions. But the key is returned as result of the call.
By that means one can set several properties for one key
using nested calls.
VReset :
The VReset functions have same effect as the basic
Reset functions.
But the value which is set is also returned as result of the call.
Trans :
The Trans functions are applicable for
properties of type DefTableKey .
They have only a key argument.
A call TransProp(k) for a property Prop
is recursively applied to the property value
until a key is reached for which the property Prop
is not set. that key is returned.
The property chain must not be cyclic.
E.g. if GetTypeOf (a, NoKey) == b and GetTypeOf (b, NoKey) == c
and GetTypeOf (c, NoKey) == NoKey , then
TransTypeOf (a) == c .
SetDiff :
The SetDiff functions
have two value arguments, like the Set functions.
The first value argument is set if the property is not yet set.
If the property has a value that differs from the first value argument,
the property is set to the second value argument.
The module also provides comparison functions CoordLess and
CoordLessEqual for source coordinates.
|