org.kiama.attribution.Attribution

CachedDynamicAttribute

abstract class CachedDynamicAttribute[T <: AnyRef, U] extends CachedAttribute[T, U]

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.

Source
Attribution.scala
Linear Supertypes
CachedAttribute[T, U], Attribution.Attribute[T, U], (T) ⇒ U, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CachedDynamicAttribute
  2. CachedAttribute
  3. Attribute
  4. Function1
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CachedDynamicAttribute(f: (T) ⇒ U)

Abstract Value Members

  1. abstract def optName: Option[String]

    An optional name, used in debugging output if present.

    An optional name, used in debugging output if present.

    Definition Classes
    Attribute

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +=(g: ==>[T, U]): Unit

    Add a new partial function to the definition of this attribute.

    Add a new partial function to the definition of this attribute. Resets the memo table for this attribute.

  5. def -=(g: ==>[T, U]): Unit

    Remove a partial function from the definition of this attribute, if it's there, otherwise have no effect.

    Remove a partial function from the definition of this attribute, if it's there, otherwise have no effect. If g appears more than once in the definition, just remove the first one. Resets the memo table for this attribute.

  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. def andThen[A](g: (U) ⇒ A): (T) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. def apply(t: T): U

    Return the value of this attribute for node t, raising an error if it depends on itself.

    Return the value of this attribute for node t, raising an error if it depends on itself. IF the value has been memoised, return it. Otherwise, the functions list is tried in order. The first partial function on that list that is defined will be used. If no partial function on this list is defined, then f will be used.

    Definition Classes
    CachedDynamicAttributeCachedAttribute → Function1
  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def block(b: ⇒ Any): Unit

    Execute a block and restore the state of this dynamic attribute after the block has executed.

    Execute a block and restore the state of this dynamic attribute after the block has executed. The idea is that the block can add to the definition of the attribute for use within the block. Any definitions that are added will be automatically removed at the end of the block.

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def compose[A](g: (A) ⇒ T): (A) ⇒ U

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  14. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  17. val functions: ListBuffer[==>[T, U]]

    List of functions that currently dynamically define this attribute.

  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hasBeenComputedAt(t: T): Boolean

    Has the value of this attribute at t already been computed or not?

    Has the value of this attribute at t already been computed or not?

    Definition Classes
    CachedAttribute
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. val memo: IdentityHashMap[T, Option[U]]

    The memo table for this attribute, with memo(t) == Some(v) represents the node t having the value v for this attribute.

    The memo table for this attribute, with memo(t) == Some(v) represents the node t having the value v for this attribute. memo(t) = None means that the attribute for t is currently being evaluated. Note that the memo table needs to be some form of identity map so that value equal trees are not treated as equal unless they are actually the same reference.

    Attributes
    protected
    Definition Classes
    CachedAttribute
  23. var memoVersion: Int

    The current version number of the memo table.

    The current version number of the memo table.

    Attributes
    protected
    Definition Classes
    CachedAttribute
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def reportCycle(t: T): U

    Report a cycle in the calculation of this attribute discovered when evaluating the attribute on value t.

    Report a cycle in the calculation of this attribute discovered when evaluating the attribute on value t. Throws an IllegalStateException.

    Definition Classes
    Attribute
  28. def reset(): Unit

    Immediately reset this attribute's memoisation cache.

    Immediately reset this attribute's memoisation cache.

    Definition Classes
    CachedAttribute
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from CachedAttribute[T, U]

Inherited from Attribution.Attribute[T, U]

Inherited from (T) ⇒ U

Inherited from AnyRef

Inherited from Any

Ungrouped