kiama.attribution

trait UncachedAttribution

[source: kiama/attribution/UncachedAttribution.scala]

trait UncachedAttribution
extends AttributionBase
Attribution of syntax trees in a functional style with attribute values computed each time they are accessed.
Direct Known Subclasses:
UncachedAttribution

Method Summary
def attr [T <: AnyRef, U](f : scala.PartialFunction[T, U]) : scala.PartialFunction[T, U]
Define an 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.
def childAttr [T <: Attributable, U](f : (T) => scala.PartialFunction[Attributable, U]) : scala.PartialFunction[T, U]
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 Attributable so that parents can be accessed.
def paramAttr [TArg, T <: AnyRef, U](f : (TArg) => scala.PartialFunction[T, U]) : (TArg) => scala.PartialFunction[T, U]
Define an attribute of T nodes of type U by the function f, which takes an argument of type TArg. The computed attribute value for a given TArg is cached so it will be computed at most once.
Methods inherited from AttributionBase
circular, constant
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class UncachedAttribute [T <: AnyRef, U](f : scala.PartialFunction[T, U]) extends scala.PartialFunction[T, U]
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.
class UncachedParamAttribute [TArg, T <: AnyRef, U](f : (TArg) => scala.PartialFunction[T, U]) extends (TArg) => scala.PartialFunction[T, U]
A variation of the UncachedAttribute class for parameterised attributes.
Method Details
def attr[T <: AnyRef, U](f : scala.PartialFunction[T, U]) : scala.PartialFunction[T, U]
Define an 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.

def paramAttr[TArg, T <: AnyRef, U](f : (TArg) => scala.PartialFunction[T, U]) : (TArg) => scala.PartialFunction[T, U]
Define an attribute of T nodes of type U by the function f, which takes an argument of type TArg. The computed attribute value for a given TArg is cached so it will be computed at most once.

def childAttr[T <: Attributable, U](f : (T) => scala.PartialFunction[Attributable, U]) : scala.PartialFunction[T, U]
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 Attributable so that parents can be accessed.