kiama.attribution

trait DynamicAttribution

[source: kiama/attribution/DynamicAttribution.scala]

trait DynamicAttribution
extends AttributionBase
Support for dynamic attribution of syntax trees. Dynamic attributes definitions can be extended at runtime.
Author
Lennart Kats
Tony Sloane
Direct Known Subclasses:
DynamicAttribution

Type Summary
type ChangeBuffer
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.
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 endUse (attributeInitializer : AnyRef) : Unit
Dectivates a module that defines dynamic attributes, activated using {@link #use}.
implicit def internalToDynamicAttribute [T <: AnyRef, U](f : (T) => U) : DynamicAttribute[T, U]
Implicitly converts partial functions to support the + operator.
def resetMemo : Unit
Lazily resets all memoisation tables.
def use [T](attributeInitializer : => AnyRef) : Unit
Activates a module that defines dynamic attributes, allowing it to be deactivated again using {@link #endUse}.
def using [T](attributeInitializer : => AnyRef)(block : => T) : T
Defines a new scope in which a dynamic attribution module is active. At the end of the scope, the module is unloaded again.
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 ComposedPartialFunction [T, U](f : scala.PartialFunction[T, U]) extends scala.PartialFunction[T, U]
A partial function composed of an ordered, mutable buffer of PartialFunction instances.
class DynamicAttribute [T, U](private f : scala.PartialFunction[T, U]) extends scala.PartialFunction[T, U]
Type Details
type ChangeBuffer

Method Details
def resetMemo : Unit
Lazily resets all memoisation tables.

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.

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.

implicit def internalToDynamicAttribute[T <: AnyRef, U](f : (T) => U) : DynamicAttribute[T, U]
Implicitly converts partial functions to support the + operator.

def using[T](attributeInitializer : => AnyRef)(block : => T) : T
Defines a new scope in which a dynamic attribution module is active. At the end of the scope, the module is unloaded again.
Parameters
attributeInitializer - A module defining dynamic attributes.
block - A block to evaluate.

def use[T](attributeInitializer : => AnyRef) : Unit
Activates a module that defines dynamic attributes, allowing it to be deactivated again using {@link #endUse}.

def endUse(attributeInitializer : AnyRef) : Unit
Dectivates a module that defines dynamic attributes, activated using {@link #use}.