Trait

org.emmalanguage.compiler.opt

Optimizations

Related Doc: package opt

Permalink

trait Optimizations extends Common with Caching with FoldForestFusion with FoldGroupFusion

Static (compile-time) optimizations.

Self Type
Optimizations with Core with ControlFlow
Linear Supertypes
FoldGroupFusion, FoldForestFusion, Caching, Common, compiler.API, AST, Variables, Values, Types, Trees, Transversers, Terms, Symbols, Patterns, Parameters, Methods, Loops, Bindings, CommonAST, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Optimizations
  2. FoldGroupFusion
  3. FoldForestFusion
  4. Caching
  5. Common
  6. API
  7. AST
  8. Variables
  9. Values
  10. Types
  11. Trees
  12. Transversers
  13. Terms
  14. Symbols
  15. Patterns
  16. Parameters
  17. Methods
  18. Loops
  19. Bindings
  20. CommonAST
  21. AnyRef
  22. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type =?>[-A, +B] = PartialFunction[A, B]

    Permalink

    Syntax sugar for partial functions.

    Syntax sugar for partial functions.

    Definition Classes
    CommonAST
  2. trait API extends BindingAPI with LoopAPI with MethodAPI with ParameterAPI with PatternAPI with SymbolAPI with TermAPI with TransverserAPI with TreeAPI with TypeAPI with ValueAPI with VariableAPI

    Permalink

    Virtual AST API.

    Virtual AST API.

    Definition Classes
    AST
  3. case class Attr[A, I, S](tree: scala.reflect.api.Universe.Tree, acc: A, inh: I, syn: S) extends Product with Serializable

    Permalink

    An attributed tree.

    An attributed tree.

    tree

    The tree being attributed.

    acc

    Accumulated attributes.

    inh

    Inherited attributes.

    syn

    Synthesized attributes.

    Definition Classes
    Transversers
  4. trait BackendAPI extends AnyRef

    Permalink

    Backend-specific APIs.

    Backend-specific APIs. This trait should be implemented by each backend.

    Definition Classes
    API
  5. trait BindingAPI extends AnyRef

    Permalink

    Bindings (values, variables and parameters).

    Bindings (values, variables and parameters).

    Examples
    // values
    val a = 42
    
    // variables
    var b = true
    
    // parameters
    def method(c: Char) = c
    (d: Double) => d
    abstract class A(e: Exception) { e.printStackTrace() }
    class C(f: Float) { println(f) }
    Definition Classes
    Bindings
  6. trait ClassAPI extends ReflectedSymbol[scala.reflect.api.Universe.ClassSymbol]

    Permalink
    Definition Classes
    API
  7. trait ComprehensionCombinatorsAPI[S <: scala.reflect.api.Universe.Symbol] extends ReflectedSymbol[S]

    Permalink
    Definition Classes
    API
  8. trait ComprehensionSyntaxAPI extends ModuleAPI

    Permalink
    Definition Classes
    API
  9. trait DSCFAnnotationsAPI extends ModuleAPI

    Permalink
    Definition Classes
    API
  10. class DataBag$API extends ModuleAPI

    Permalink
    Definition Classes
    API
  11. class DataBagAPI extends ClassAPI

    Permalink
    Definition Classes
    API
  12. trait GraphRepresentationAPI extends ModuleAPI

    Permalink
    Definition Classes
    API
  13. class Group$API extends ModuleAPI

    Permalink
    Definition Classes
    API
  14. trait GroupAPI extends ClassAPI

    Permalink
    Definition Classes
    API
  15. trait LoopAPI extends AnyRef

    Permalink

    Loops (while and do-while).

    Loops (while and do-while).

    Definition Classes
    Loops
  16. trait ManagedAttr[A <: HList, I <: HList, S <: HList] extends (scala.reflect.api.Universe.Tree) ⇒ AST.Attr[A, I, S]

    Permalink

    Utility for managing attribute grammars.

    Utility for managing attribute grammars.

    Definition Classes
    Transversers
  17. trait Meta extends AnyRef

    Permalink

    Meta information (attachments).

    Meta information (attachments).

    Definition Classes
    CommonAST
  18. trait MethodAPI extends AnyRef

    Permalink

    Methods (defs).

    Methods (defs).

    Examples
    // definitions
    def pi = 3.14
    def greet() = println("Hello, World!")
    def nil[A] = List.empty[A]
    def pNil[A]() = println(nil[A])
    def succ(i: Int) = i + 1
    def one[A](a: A) = a :: Nil
    def add(x: Int, y: Int) = x + y
    def pair[A, B](a: A, b: B) = (a, b)
    def addCurry(x: Int)(y: Int) = x + y
    def pairCurry[A, B](a: A)(b: B) = (a, b)
    def zero[N: Numeric] = implicitly[Numeric[N]].zero
    def times2[N](n: N)(implicit N: Numeric[N]) = N.times(n, N.fromInt(2))
    
    // calls
    pi
    greet()
    nil[String]
    pNil[String]()
    succ(42)
    one[Char]('1')
    add(2, 3)
    pair[String, Double]("pi = ", 3.14)
    addCurry(2)(3)
    pairCurry[String, Double]("pi = ")(3.14)
    zero[Double]
    times2[Long](5)
    Definition Classes
    Methods
  19. trait ModuleAPI extends ReflectedSymbol[scala.reflect.api.Universe.ModuleSymbol]

    Permalink
    Definition Classes
    API
  20. class MutableBag$API extends ModuleAPI

    Permalink
    Definition Classes
    API
  21. class MutableBagAPI extends ClassAPI

    Permalink
    Definition Classes
    API
  22. trait Node extends AnyRef

    Permalink

    Common parent for all virtual AST nodes.

    Common parent for all virtual AST nodes.

    Definition Classes
    CommonAST
  23. class OpsAPI extends ModuleAPI with ComprehensionCombinatorsAPI[scala.reflect.api.Universe.ModuleSymbol] with RuntimeAPI[scala.reflect.api.Universe.ModuleSymbol]

    Permalink
    Definition Classes
    API
  24. trait ParameterAPI extends AnyRef

    Permalink

    (method / lambda) Parameters.

    (method / lambda) Parameters.

    Examples
    def method(c: Char) = c
    (d: Double) => d
    abstract class A(e: Exception) { e.printStackTrace() }
    class C(f: Float) { println(f) }
    Definition Classes
    Parameters
  25. trait PatternAPI extends AnyRef

    Permalink

    Patterns (for pattern matching).

    Patterns (for pattern matching).

    Definition Classes
    Patterns
  26. trait ReflectedSymbol[S <: scala.reflect.api.Universe.Symbol] extends AnyRef

    Permalink
    Definition Classes
    API
  27. trait RuntimeAPI[S <: scala.reflect.api.Universe.Symbol] extends ReflectedSymbol[S]

    Permalink
    Definition Classes
    API
  28. case class Strategy[A <: HList, I <: HList, S <: HList](grammar: AST.AttrGrammar[A, I, S], factory: AST.Factory) extends Product with Serializable

    Permalink

    A traversal / transformation strategy.

    A traversal / transformation strategy. 4 fundamental strategies are available:

    1. Top-down continue left-to-right 2. Top-down break left-to-right 3. Bottom-up continue left-to-right 4. Bottom-up break left-to-right

    Right-to-left variants are not supported.

    Definition Classes
    Transversers
  29. trait SymbolAPI extends AnyRef

    Permalink
    Definition Classes
    Symbols
  30. trait TermAPI extends AnyRef

    Permalink
    Definition Classes
    Terms
  31. abstract class Transform[A <: HList, I <: HList, S <: HList] extends scala.reflect.api.Universe.Transformer with AST.ManagedAttr[A, I, S]

    Permalink

    An abstract transformation (default is top-down break).

    An abstract transformation (default is top-down break).

    Definition Classes
    Transversers
  32. trait TransverserAPI extends AnyRef

    Permalink

    Fluent tree traversal / transformation APIs.

    Fluent tree traversal / transformation APIs.

    Definition Classes
    Transversers
  33. abstract class Traversal[A <: HList, I <: HList, S <: HList] extends scala.reflect.api.Universe.Traverser with AST.ManagedAttr[A, I, S]

    Permalink

    An abstract traversal (default is top-down break).

    An abstract traversal (default is top-down break).

    Definition Classes
    Transversers
  34. trait TreeAPI extends AnyRef

    Permalink
    Definition Classes
    Trees
  35. trait TypeAPI extends AnyRef

    Permalink
    Definition Classes
    Types
  36. trait ValueAPI extends AnyRef

    Permalink

    Values (vals).

    Values (vals).

    Examples
    val x = 42
    println(x)
    object Math { val pi = 3.14 }
    println(Math.pi)
    ("Hello", '!')._1
    println(math.e)
    import scala.math.e
    println(e)
    Definition Classes
    Values
  37. trait VariableAPI extends AnyRef

    Permalink

    Variables (vars).

    Variables (vars).

    Examples
    var x = 42
    x = x * 2
    object Greet { var hi = "Hello" }
    println(Greet.hi + ", World!")
    // This is a `Def.Call` of the method `hi_=`, not a `Var.Mut`:
    Greet.hi = "Hola"
    Definition Classes
    Variables
  38. trait emmaAPI extends ModuleAPI

    Permalink
    Definition Classes
    API

Abstract Value Members

  1. abstract def abort(msg: String, pos: scala.reflect.api.Universe.Position = NoPosition): Nothing

    Permalink

    Raises an error and terminates compilation.

    Raises an error and terminates compilation.

    Definition Classes
    CommonAST
  2. abstract def enclosingOwner: scala.reflect.api.Universe.Symbol

    Permalink

    Returns the enclosing named entity (class, method, value, etc).

    Returns the enclosing named entity (class, method, value, etc).

    Definition Classes
    CommonAST
  3. abstract def eval[T](code: scala.reflect.api.Universe.Tree): T

    Permalink

    Evaluates a snippet of code and returns a value of type T.

    Evaluates a snippet of code and returns a value of type T. Note: this can be called on type--checked trees (as opposed to the eval method in ToolBox).

    Definition Classes
    CommonAST
  4. abstract def inferImplicit(tpe: scala.reflect.api.Universe.Type): Option[scala.reflect.api.Universe.Tree]

    Permalink

    Infers an implicit value from the enclosing context (if possible).

    Infers an implicit value from the enclosing context (if possible).

    Definition Classes
    CommonAST
  5. abstract def meta(tree: scala.reflect.api.Universe.Tree): (Optimizations.this)#Meta

    Permalink

    Returns the meta information associated with tree.

    Returns the meta information associated with tree.

    Definition Classes
    CommonAST
  6. abstract def meta(sym: scala.reflect.api.Universe.Symbol): (Optimizations.this)#Meta

    Permalink

    Returns the meta information associated with sym.

    Returns the meta information associated with sym.

    Definition Classes
    CommonAST
  7. abstract def parse(code: String): scala.reflect.api.Universe.Tree

    Permalink

    Parses a snippet of source code and returns the AST.

    Parses a snippet of source code and returns the AST.

    Definition Classes
    CommonAST
  8. abstract def pipeline(typeCheck: Boolean = false, withPre: Boolean = true, withPost: Boolean = true)(transformations: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree*): (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Combines a sequence of transformations into a pipeline with pre- and post-processing.

    Combines a sequence of transformations into a pipeline with pre- and post-processing.

    Definition Classes
    Common
  9. abstract def postProcess: Seq[(scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree]

    Permalink

    Standard pipeline suffix.

    Standard pipeline suffix. Brings a tree into a form acceptable for scalac after being transformed.

    Definition Classes
    Common
  10. abstract def preProcess: Seq[(scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree]

    Permalink

    Standard pipeline prefix.

    Standard pipeline prefix. Brings a tree into a form convenient for transformation.

    Definition Classes
    Common
  11. abstract def typeCheck(tree: scala.reflect.api.Universe.Tree, typeMode: Boolean = false): scala.reflect.api.Universe.Tree

    Permalink

    Type-checks a tree (use typeMode=true for type-trees).

    Type-checks a tree (use typeMode=true for type-trees).

    Definition Classes
    CommonAST
  12. abstract val u: Universe

    Permalink
    Definition Classes
    CommonAST
  13. abstract def warning(msg: String, pos: scala.reflect.api.Universe.Position = NoPosition): Unit

    Permalink

    Raises a compiler warning.

    Raises a compiler warning.

    Definition Classes
    CommonAST

Concrete 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. object API

    Permalink

    Reflection of the Emma API.

    Reflection of the Emma API.

    Definition Classes
    API
  5. object Attr extends Serializable

    Permalink
    Definition Classes
    Transversers
  6. lazy val Flags: Set[scala.reflect.api.Universe.FlagSet]

    Permalink

    All explicit flags.

    All explicit flags.

    Definition Classes
    CommonAST
  7. lazy val FlagsNoSynthetic: Set[scala.reflect.api.Universe.FlagSet]

    Permalink
    Definition Classes
    CommonAST
  8. object Max

    Permalink

    Constant limits.

    Constant limits.

    Definition Classes
    CommonAST
  9. object Optimizations

    Permalink

    Static (compile-time) optimizations.

  10. object UniverseImplicits

    Permalink

    Factors out the implicit objects that need to be imported from the Scala universe.

    Factors out the implicit objects that need to be imported from the Scala universe.

    Please use

    import UniverseImplicits._
    
    u.Type
    u.method

    as opposed to

    import universe._ // or import u._
    
    Type
    method

    in order to make the parts of the Emma compiler which depend on the Scala metaprogramming API explicit.

    Attributes
    protected[org.emmalanguage]
    Definition Classes
    AST
  11. object Validation

    Permalink

    Common validation helpers.

    Common validation helpers.

    Definition Classes
    Common
  12. object api extends API

    Permalink

    Virtual non-overlapping semantic AST based on Scala trees.

    Virtual non-overlapping semantic AST based on Scala trees.

    Definition Classes
    AST
  13. object are

    Permalink
    Definition Classes
    CommonAST
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. def asSource(title: String)(tree: scala.reflect.api.Universe.Tree): String

    Permalink

    Prints tree for debugging.

    Prints tree for debugging.

    Makes a best effort to shorten the resulting source code for better readability, especially removing particular package qualifiers. Does not return parseable source code.

    title

    Useful to distinguish different printouts from each other.

    tree

    The tree to print as source code.

    returns

    The printable source code.

    Definition Classes
    AST
  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. lazy val fixSymbolTypes: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Populates the missing types of lambda symbols in a tree.

    Populates the missing types of lambda symbols in a tree. WARN: Mutates the symbol table in place.

    Definition Classes
    AST
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. object has

    Permalink
    Definition Classes
    CommonAST
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. object have

    Permalink
    Definition Classes
    CommonAST
  25. def identity(typeCheck: Boolean = false): (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    The identity transformation with pre- and post-processing.

    The identity transformation with pre- and post-processing.

    Definition Classes
    Common
  26. object is

    Permalink
    Definition Classes
    CommonAST
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. def nameClashes(tree: scala.reflect.api.Universe.Tree): Seq[scala.reflect.api.Universe.TermSymbol]

    Permalink

    Returns a sequence of symbols in tree that have clashing names.

    Returns a sequence of symbols in tree that have clashing names.

    Definition Classes
    AST
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. lazy val normalizeStatements: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Normalizes all statements in term position by wrapping them in a block.

    Normalizes all statements in term position by wrapping them in a block.

    Definition Classes
    AST
  31. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  33. lazy val qualifyStatics: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Fully qualifies references to static symbols.

    Fully qualifies references to static symbols.

    Definition Classes
    AST
  34. lazy val removeShadowedThis: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Rewrites A.this.x as x if A is shadowed another symbol in the owner chain.

    Rewrites A.this.x as x if A is shadowed another symbol in the owner chain.

    Can be used before showCode to avoid printing invalid trees such as

    class A {
      val x = 42;
      class A {
        scala.Predef.println(A.this.x)
      }
    }
    Definition Classes
    AST
  35. lazy val resolveNameClashes: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Ensures that all definitions within tree have unique names.

    Ensures that all definitions within tree have unique names.

    Definition Classes
    AST
  36. lazy val restoreTypeTrees: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Restores u.TypeTrees with their original field set.

    Restores u.TypeTrees with their original field set.

    Definition Classes
    AST
  37. lazy val shadowedOwners: Set[scala.reflect.api.Universe.Symbol]

    Permalink

    Computes a set of owners whose name is shadowed in the current scope.

    Computes a set of owners whose name is shadowed in the current scope.

    Definition Classes
    AST
  38. lazy val stubTypeTrees: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Replaces u.TypeTrees that have their original field set with stubs that only have their tpe field set to the corresponding type.

    Replaces u.TypeTrees that have their original field set with stubs that only have their tpe field set to the corresponding type. Type-trees of val/vars are left empty for the compiler to infer.

    Definition Classes
    AST
  39. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  41. lazy val unQualifyStatics: (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink

    Removes the qualifiers from references to static symbols.

    Removes the qualifiers from references to static symbols.

    Definition Classes
    AST
  42. def unTypeCheck(tree: scala.reflect.api.Universe.Tree): scala.reflect.api.Universe.Tree

    Permalink

    Removes all type and symbol attributes from a tree.

    Removes all type and symbol attributes from a tree.

    Definition Classes
    CommonAST
  43. final def wait(): Unit

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

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

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

Inherited from FoldGroupFusion

Inherited from FoldForestFusion

Inherited from Caching

Inherited from Common

Inherited from compiler.API

Inherited from AST

Inherited from Variables

Inherited from Values

Inherited from Types

Inherited from Trees

Inherited from Transversers

Inherited from Terms

Inherited from Symbols

Inherited from Patterns

Inherited from Parameters

Inherited from Methods

Inherited from Loops

Inherited from Bindings

Inherited from CommonAST

Inherited from AnyRef

Inherited from Any

Ungrouped