Class

org.bitbucket.inkytonik.kiama.attribution

Decorators

Related Doc: package attribution

Permalink

class Decorators[T <: Product, R <: T] extends AnyRef

Decorators are higher-order operations that provide common patterns of tree attribution based on simple attributes or functions. A Tree must be supplied to give the decorators access to the tree structure.

Source
Decorators.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Decorators
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Decorators(tree: Tree[T, R])

    Permalink

Type Members

  1. case class Chain[U](in: (T) ⇒ U, out: (T) ⇒ U) extends (T) ⇒ U with Product with Serializable

    Permalink

    A pair of attributes that thread through a tree in a depth-first left-to-right fashion.

    A pair of attributes that thread through a tree in a depth-first left-to-right fashion. The in (out) attributes provides the value of the chain as it enters a node from above (leaves a node to the above).

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. def atRoot[U](a: (T) ⇒ U): Attribution.CachedAttribute[T, U]

    Permalink

    A decorator that progagates an attribute value down the tree.

    A decorator that progagates an attribute value down the tree. The partial function a should define the value of the attribute at the root. The value defined at the root will also be made available at all other nodes.

  6. val attribution: Attribution

    Permalink
  7. def chain[U](inupdate: ((T) ⇒ U) ⇒ ==>[T, U] = idf[U], outupdate: ((T) ⇒ U) ⇒ ==>[T, U] = idf[U]): Chain[U]

    Permalink

    Create a new attribute chain.

    Create a new attribute chain. The update functions provide ways to influence the chain value, by taking the default computation of the in or out attribute and returning a partial function. If the domain of the partial function contains a node, then that function is used to compute the chain value at the node n, otherwise the default chain attribute is used. If an update function is omitted, it defaults to the identity.

    If the root of the tree is reached without a definition being supplied for the chain, a runtime exception is thrown. Both of the components of the chain are reset to avoid errors for cyclic if the exception is caught and they are subsequently evaluated again.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def down[U](default: U)(a: ==>[T, U]): Attribution.CachedAttribute[T, U]

    Permalink

    Variant of down that takes a default value instead of a default function.

  10. def down[U](default: (T) ⇒ U)(a: ==>[T, U]): Attribution.CachedAttribute[T, U]

    Permalink

    A decorator that propagates an attribute value down the tree.

    A decorator that propagates an attribute value down the tree. The partial function a should define the value of the attribute at nodes where it is known. If a does not define a value for the attribute at a particular node, then the decorator asks the parent of the node for its value of the attribute and uses that value. If no node on the path to the root defines a value for the attribute, then default applied to the root is returned.

  11. def downErr[U](a: ==>[T, U]): Attribution.CachedAttribute[T, U]

    Permalink

    Variant of down that throws an error if a is not defined on the path to the root of the tree.

  12. def downOpt[U](a: ==>[T, U]): Attribution.CachedAttribute[T, Option[U]]

    Permalink

    Variant of down that returns None if a is not defined on the path to the root of the tree, otherwise it wraps the value that a returns in Some.

  13. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped