Class

org.bitbucket.inkytonik.kiama.attribution

Attribution

Related Doc: package attribution

Permalink

class Attribution extends AttributionCore

An attribution module. Use an instance of this module to encapuslate related attributes. You should ensure that more than one circular attribute evaluation from a single module is not executing at the same time because the current implementation has shared state between related circular attributes. If your attributes are unrelated (i.e., can't possibly call each other) you should base them on different attribution module instances and then it is safe for attributes from different collections to execute in parallel.

Source
Attribution.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Attribution
  2. AttributionCore
  3. AttributionCommon
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Attribution()

    Permalink

Type Members

  1. class CachedAttribute[T, U] extends Attribute[T, U]

    Permalink

    An attribute of a node type T with value of type U, supported by a memo table and circularity test.

    An attribute of a node type T with value of type U, supported by a memo table and circularity test. The value of the attribute is computed by the function f. The result is memoised so that it is only evaluated once. f should not itself require the value of this attribute. If it does, a circularity error is reported by throwing an IllegalStateException.

    Definition Classes
    AttributionCore
  2. class CachedDynamicAttribute[T, U] extends CachedAttribute[T, U]

    Permalink

    A cached dynamic 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. The value of the attribute is initially computed by the function f, but the definition can be augmented dynamically. The result is memoised so that it is only evaluated once for a given definition. The attribute definition should not itself require the value of this attribute. If it does, a circularity error is reported by throwing an IllegalStateException. This kind of attribute encapsulates state to keep track of the current definition, so an instance should only be used from one thread at a time.

    Definition Classes
    AttributionCore
  3. class CachedParamAttribute[A, T, U] extends (A) ⇒ Attribute[T, U]

    Permalink

    A variation of the CachedAttribute class for parameterised attributes.

    A variation of the CachedAttribute class for parameterised attributes.

    Definition Classes
    AttributionCore
  4. class CircularAttribute[T, U] extends Attribute[T, U]

    Permalink

    An attribute of a node type T with value of type U which has a circular definition.

    An attribute of a node type T with value of type U which has a circular definition. The value of the attribute is computed by the function f which may itself use the value of the attribute. init specifies an initial value for the attribute. The attribute (and any circular attributes on which it depends) are evaluated until no value changes (i.e., a fixed point is reached). The final result is memoised so that subsequent evaluations return the same value.

    This code implements the basic circular evaluation algorithm from "Circular Reference Attributed Grammars - their Evaluation and Applications", by Magnusson and Hedin from LDTA 2003.

    Definition Classes
    AttributionCore
  5. class ConstantAttribute[T, U] extends Attribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCommon

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. macro def attr[T, U](f: (T) ⇒ U): CachedAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  6. def attrWithName[T, U](name: String, f: (T) ⇒ U): CachedAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  7. macro def circular[T, U](init: U)(f: (T) ⇒ U): CircularAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  8. def circularWithName[T, U](name: String, init: U)(f: (T) ⇒ U): CircularAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def constant[T, U](name: String, u: ⇒ U): Attribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCommon
  11. macro def constant[T, U](u: ⇒ U): Attribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCommon
  12. macro def dynAttr[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  13. def dynAttrWithName[T, U](name: String, f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. implicit def internalToDynamicAttribute[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. macro def paramAttr[V, T, U](f: (V) ⇒ (T) ⇒ U): CachedParamAttribute[V, T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  25. def paramAttrWithName[V, T, U](name: String, f: (V) ⇒ (T) ⇒ U): CachedParamAttribute[V, T, U]

    Permalink

    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.

    Definition Classes
    AttributionCore
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AttributionCore

Inherited from AttributionCommon

Inherited from AnyRef

Inherited from Any

Ungrouped