Trait

org.emmalanguage.compiler

API

Related Doc: package compiler

Permalink

trait API extends AST

Common IR tools.

Attributes
protected[org.emmalanguage]
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. API
  2. AST
  3. Variables
  4. Values
  5. Types
  6. Trees
  7. Transversers
  8. Terms
  9. Symbols
  10. Patterns
  11. Parameters
  12. Methods
  13. Loops
  14. Bindings
  15. CommonAST
  16. AnyRef
  17. 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.

  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
  7. trait ComprehensionCombinatorsAPI[S <: scala.reflect.api.Universe.Symbol] extends ReflectedSymbol[S]

    Permalink
  8. trait ComprehensionSyntaxAPI extends ModuleAPI

    Permalink
  9. trait DSCFAnnotationsAPI extends ModuleAPI

    Permalink
  10. class DataBag$API extends ModuleAPI

    Permalink
  11. class DataBagAPI extends ClassAPI

    Permalink
  12. trait GraphRepresentationAPI extends ModuleAPI

    Permalink
  13. class Group$API extends ModuleAPI

    Permalink
  14. trait GroupAPI extends ClassAPI

    Permalink
  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
  20. class MutableBag$API extends ModuleAPI

    Permalink
  21. class MutableBagAPI extends ClassAPI

    Permalink
  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
  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
  27. trait RuntimeAPI[S <: scala.reflect.api.Universe.Symbol] extends ReflectedSymbol[S]

    Permalink
  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

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): 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): 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 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
  9. abstract val u: Universe

    Permalink
    Definition Classes
    CommonAST
  10. 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.

  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 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
  10. 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
  11. object are

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

    Permalink
    Definition Classes
    Any
  13. 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
  14. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. 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
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. object has

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. object have

    Permalink
    Definition Classes
    CommonAST
  23. object is

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

    Permalink
    Definition Classes
    Any
  25. 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
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. 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
  28. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  38. 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
  39. 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
  40. final def wait(): Unit

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

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

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

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