Trait

org.emmalanguage.ast

AST

Related Doc: package ast

Permalink

trait AST extends CommonAST with Bindings with Loops with Methods with Parameters with Patterns with Symbols with Terms with Transversers with Trees with Types with Values with Variables

Common super-trait for macro- and runtime-compilation.

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

  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 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
  5. trait LoopAPI extends AnyRef

    Permalink

    Loops (while and do-while).

    Loops (while and do-while).

    Definition Classes
    Loops
  6. 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
  7. trait Meta extends AnyRef

    Permalink

    Meta information (attachments).

    Meta information (attachments).

    Definition Classes
    CommonAST
  8. 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
  9. trait Node extends AnyRef

    Permalink

    Common parent for all virtual AST nodes.

    Common parent for all virtual AST nodes.

    Definition Classes
    CommonAST
  10. 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
  11. trait PatternAPI extends AnyRef

    Permalink

    Patterns (for pattern matching).

    Patterns (for pattern matching).

    Definition Classes
    Patterns
  12. 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
  13. trait SymbolAPI extends AnyRef

    Permalink
    Definition Classes
    Symbols
  14. trait TermAPI extends AnyRef

    Permalink
    Definition Classes
    Terms
  15. 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
  16. trait TransverserAPI extends AnyRef

    Permalink

    Fluent tree traversal / transformation APIs.

    Fluent tree traversal / transformation APIs.

    Definition Classes
    Transversers
  17. 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
  18. trait TreeAPI extends AnyRef

    Permalink
    Definition Classes
    Trees
  19. sealed trait TreeTransform extends AnyRef

    Permalink
    Definition Classes
    CommonAST
  20. trait TypeAPI extends AnyRef

    Permalink
    Definition Classes
    Types
  21. 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
  22. 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
  23. type Xfrm = TreeTransform

    Permalink
    Definition Classes
    CommonAST
  24. trait XfrmAlg[B] extends AnyRef

    Permalink
    Definition Classes
    CommonAST
  25. trait XfrmEval extends AnyRef

    Permalink
    Definition Classes
    CommonAST
  26. implicit class XfrmOps extends (scala.reflect.api.Universe.Tree) ⇒ scala.reflect.api.Universe.Tree

    Permalink
    Definition Classes
    CommonAST

Abstract Value Members

  1. abstract def abort(msg: String, pos: scala.reflect.api.Universe.Position = u.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 = u.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 Attr extends Serializable

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

    Permalink

    All explicit flags.

    All explicit flags.

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

    Permalink
    Definition Classes
    CommonAST
  7. object Max

    Permalink

    Constant limits.

    Constant limits.

    Definition Classes
    CommonAST
  8. object NaiveEval extends XfrmEval

    Permalink

    Just evaluate the tree transform.

    Just evaluate the tree transform.

    Definition Classes
    CommonAST
  9. object TimerEval extends XfrmEval

    Permalink

    Evaluate and time each node.

    Evaluate and time each node.

    Definition Classes
    CommonAST
  10. object TreeTransform

    Permalink
    Definition Classes
    CommonAST
  11. 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
    CommonAST
  12. final val Xfrm: TreeTransform.type

    Permalink
    Definition Classes
    CommonAST
  13. object api extends API

    Permalink

    Virtual non-overlapping semantic AST based on Scala trees.

  14. object are

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

    Permalink
    Definition Classes
    Any
  16. 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.

  17. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. lazy val fixSymbolTypes: Xfrm

    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.

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. object has

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

    Permalink
    Definition Classes
    AnyRef → Any
  25. object have

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

  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. val noop: Xfrm

    Permalink
    Definition Classes
    CommonAST
  31. lazy val normalizeStatements: Xfrm

    Permalink

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

  32. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  34. lazy val qualifyStatics: Xfrm

    Permalink

    Fully qualifies references to static symbols.

  35. lazy val removeShadowedThis: Xfrm

    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)
      }
    }
  36. lazy val resolveNameClashes: Xfrm

    Permalink

    Ensures that all definitions within tree have unique names.

  37. lazy val restoreTypeTrees: Xfrm

    Permalink

    Restores u.TypeTrees with their original field set.

  38. lazy val shadowedOwners: Set[scala.reflect.api.Universe.Symbol]

    Permalink

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

  39. lazy val stubTypeTrees: Xfrm

    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.

  40. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  42. lazy val unQualifyStatics: Xfrm

    Permalink

    Removes the qualifiers from references to static symbols.

  43. 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
  44. final def wait(): Unit

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

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

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

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