An attribute of a node type T
with value of type U
, supported by a memo
table and circularity test.
A cached dynamic attribute of a node type T
with value of type U
, supported
by a memo table and circularity test.
A variation of the CachedAttribute
class for parameterised attributes.
An attribute of a node type T
with value of type U
which has a circular
definition.
A constant attribute of a node type T
with value of type U
.
A memoised entity that weakly holds onto its keys and uses identity to compare them.
A memoised entity that uses equality to compare keys.
Common interface for encapsulation of memoisation for a single memoised entity backed by a configurable cache.
As for the other attr
with the first argument specifying a name for
the constructed attribute.
As for the other attr
with the first argument specifying a name for
the constructed attribute.
Define a cached attribute of T
nodes of type U
by the function f
,
which should not depend on the value of this attribute.
Define a cached attribute of T
nodes of type U
by the function f
,
which should not depend on the value of this attribute. The computed
attribute value is cached so it will be computed at most once.
As for the other childAttr
with the first argument specifying a name for
the constructed attribute.
As for the other childAttr
with the first argument specifying a name for
the constructed attribute.
Define an attribute of T
nodes of type U
by the function f
, which
takes the current node and its parent as its arguments.
Define an attribute of T
nodes of type U
by the function f
, which
takes the current node and its parent as its arguments. T
must be
a sub-type of Attributable
so that parents can be accessed generically.
As for the other circular
with the first argument specifying a name for
the constructed attribute.
As for the other circular
with the first argument specifying a name for
the constructed attribute.
Define an optionally named circular attribute of T
nodes of type U
by the function f
.
Define an optionally named circular attribute of T
nodes of type U
by the function f
. f
is allowed to depend on the value of this
attribute, which will be given by init
initially and will be evaluated
iteratively until a fixed point is reached (in conjunction with other
circular attributes on which it depends). The final value is cached.
As for the other constant
with the first argument specifying a name for
the constructed attribute.
As for the other constant
with the first argument specifying a name for
the constructed attribute.
Define a constant attribute of T
nodes of type U
given by the value
u
.
Define a constant attribute of T
nodes of type U
given by the value
u
. u
is evaluated at most once.
As for the other dynAttr
with the first argument specifying a name for
the constructed attribute.
As for the other dynAttr
with the first argument specifying a name for
the constructed attribute.
Define a cached dynamic attribute of T
nodes of type U
by the partial
function f
, which should not depend on the value of this attribute.
Define a cached dynamic attribute of T
nodes of type U
by the partial
function f
, which should not depend on the value of this attribute.
The computed attribute value is cached so it will be computed at most once.
Initialise the Attributable
tree rooted at t
so that it is ready for
attribution.
Initialise the Attributable
tree rooted at t
so that it is ready for
attribution. At present, the only initialisation performed is to set node
attributes such as parent and children so that nodes can generically refer
to their neighbours. If you wish to use any of these properties, you must
call this method before doing so. Otherwise, the node properties should
not be used and there is no need to call this method.
Implicitly converts functions to dynamic attributes.
Implicitly converts functions to dynamic attributes. This conversion allows us to use simpler types for dynamic attributes, but still extend them later.
As for the other paramAttr
with the first argument specifying a name for
the constructed attribute.
As for the other paramAttr
with the first argument specifying a name for
the constructed attribute.
Define a parameterised attribute of T
nodes of type U
by the function
f
, which takes an argument of type V
.
Define a parameterised attribute of T
nodes of type U
by the function
f
, which takes an argument of type V
. The computed attribute value
for a given V
and T
pair is cached so it will be computed at most
once.
Lazily reset all memoisation tables.
Lazily reset all memoisation tables. The actual resets will only happen the next time the value of each attribute is accessed.
As for the other tree
with the first argument specifying a name for
the constructed attribute.
As for the other tree
with the first argument specifying a name for
the constructed attribute.
Define an optionally named attribute as per attr
, except that the
attribute must have a tree value and will be spliced into the tree to
have the same parent as the node on which it is defined.
Define an optionally named attribute as per attr
, except that the
attribute must have a tree value and will be spliced into the tree to
have the same parent as the node on which it is defined. This kind of
attribute is used to generate new trees that must share context
with the node on which they are defined.
Module for cached attributes.