A constant attribute of a node type T
with value of type U
.
A constant attribute of a node type T
with value of type U
. The
value is given by the computation u
which is evaluated at most once.
A memoised entity that weakly holds onto its keys and uses identity to compare them.
A memoised entity that weakly holds onto its keys and uses identity to compare them.
A memoised entity that uses equality to compare keys.
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.
Common interface for encapsulation of memoisation for a single memoised entity backed by a configurable cache.
An attribute of a node type T
with value of type U
, supported by a circularity
test.
An attribute of a node type T
with value of type U
, supported by a circularity
test. The value of the attribute is computed by the function f
. f
will be
called each time the value of the attribute is accessed. f
should not itself
require the value of this attribute. If it does, a circularity error is reported
by throwing an IllegalStateException
.
A variation of the UncachedAttribute
class for parameterised attributes.
As for the other attr
with the first argument specifying a name for
the constructed attribute.
Define an uncached attribute of T
nodes of type U
by the function f
,
which should not depend on the value of this attribute.
Define an uncached 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.
Define an uncached attribute of T
nodes of type U
by the function f
,
which takes the current node and its parent as its arguments.
Define an uncached 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 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.
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.
As for the other paramAttr
with the first argument specifying a name for
the constructed attribute.
Define a parameterised uncached attribute of T
nodes of type U
by the
function f
, which takes an argument of type A
.
Define a parameterised uncached attribute of T
nodes of type U
by the
function f
, which takes an argument of type A
. The computed attribute
value for a given T
and A
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.
Reusable implementation of attribution of syntax trees in a functional style with attribute values computed each time they are accessed.