scala.quasiquotes

TreeGen

abstract class TreeGen extends SymbolTableCompat

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TreeGen
  2. SymbolTableCompat
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeGen()

Type Members

  1. trait CommonNames extends AnyRef

    Definition Classes
    SymbolTableCompat
  2. class GetVarTraverser extends reflect.internal.SymbolTable.Traverser

    Traverse pattern and collect all variable names with their types in buffer The variables keep their positions; whereas the pattern is converted to be synthetic for all nodes that contain a variable position.

  3. trait KeywordNames extends AnyRef

    Definition Classes
    SymbolTableCompat

Abstract Value Members

  1. abstract val global: SymbolTable

    Definition Classes
    TreeGenSymbolTableCompat

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. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  6. object Filter

    Encode/decode fq"if $cond" enumerator as q"if($cond)"

  7. object ValEq

    Encode/decode fq"$pat = $rhs" enumerator as q"$pat = $rhs"

  8. object ValFrom

    Encode/decode fq"$pat <- $rhs" enumerator as q"<-($pat, $rhs)"

  9. object Yield

    Encode/decode body of for yield loop as q"yield($tree)"

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. lazy val build: ReificationSupport { val global: TreeGen.this.global.type }

    Definition Classes
    SymbolTableCompat
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def convertToTypeName(tree: reflect.internal.SymbolTable.Tree): Option[reflect.internal.SymbolTable.RefTree]

    Translate names in Select/Ident nodes to type names.

  14. object definitions

    Definition Classes
    SymbolTableCompat
  15. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. lazy val gen: TreeGen { val global: TreeGen.this.global.type }

    Definition Classes
    SymbolTableCompat
  19. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  22. final def mapList[A, B](as: List[A])(f: (A) ⇒ B): List[B]

    A version of List#map, specialized for List, and optimized to avoid allocation if as is empty

  23. def maybeMkAsInstanceOf(tree: reflect.internal.SymbolTable.Tree, pt: reflect.internal.SymbolTable.Type, tpe: reflect.internal.SymbolTable.Type, beforeRefChecks: Boolean = false): reflect.internal.SymbolTable.Tree

    Cast tree to pt, unless tpe is a subtype of pt, or pt is Unit.

  24. def mkAnd(tree1: reflect.internal.SymbolTable.Tree, tree2: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

  25. def mkAnonymousNew(stats: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  26. def mkAppliedTypeTree(fun: reflect.internal.SymbolTable.Tree, targs: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  27. def mkApplyIfNeeded(qual: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    If this is a reference to a method with an empty parameter list, wrap it in an apply.

  28. def mkAsInstanceOf(value: reflect.internal.SymbolTable.Tree, tpe: reflect.internal.SymbolTable.Type, any: Boolean = true, wrapInApply: Boolean = true): reflect.internal.SymbolTable.Tree

    Builds a cast with given value and type.

  29. def mkAssign(lhs: reflect.internal.SymbolTable.Tree, rhs: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Create a tree representing an assignment <lhs = rhs>

  30. def mkAttributedIdent(sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.RefTree

  31. def mkAttributedQualifier(tpe: reflect.internal.SymbolTable.Type, termSym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.Tree

    Builds a reference to value whose type is given stable prefix.

    Builds a reference to value whose type is given stable prefix. If the type is unsuitable, e.g. it is a TypeRef for an abstract type variable, then an Ident will be made using termSym as the Ident's symbol. In that case, termSym must not be NoSymbol.

  32. def mkAttributedQualifier(tpe: reflect.internal.SymbolTable.Type): reflect.internal.SymbolTable.Tree

    Builds a reference to value whose type is given stable prefix.

    Builds a reference to value whose type is given stable prefix. The type must be suitable for this. For example, it must not be a TypeRef pointing to an abstract type variable.

  33. def mkAttributedRef(sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.RefTree

    Builds a reference to given symbol.

  34. def mkAttributedRef(pre: reflect.internal.SymbolTable.Type, sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.RefTree

    Builds a reference to given symbol with given stable prefix.

  35. def mkAttributedSelect(qual: reflect.internal.SymbolTable.Tree, sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.RefTree

  36. def mkAttributedStableRef(sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.Tree

  37. def mkAttributedStableRef(pre: reflect.internal.SymbolTable.Type, sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.Tree

    Builds a reference with stable type to given symbol

  38. def mkAttributedThis(sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.This

  39. def mkAttributedTypeApply(target: reflect.internal.SymbolTable.Tree, method: reflect.internal.SymbolTable.Symbol, targs: List[reflect.internal.SymbolTable.Type]): reflect.internal.SymbolTable.Tree

  40. def mkBlock(stats: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

    Create block of statements stats

  41. def mkCast(tree: reflect.internal.SymbolTable.Tree, pt: reflect.internal.SymbolTable.Type): reflect.internal.SymbolTable.Tree

  42. def mkCheckIfRefutable(pat: reflect.internal.SymbolTable.Tree, rhs: reflect.internal.SymbolTable.Tree)(implicit fresh: FreshNameCreator): reflect.internal.SymbolTable.Tree

  43. def mkClassDef(mods: reflect.internal.SymbolTable.Modifiers, name: reflect.internal.SymbolTable.TypeName, tparams: List[reflect.internal.SymbolTable.TypeDef], templ: reflect.internal.SymbolTable.Template): reflect.internal.SymbolTable.ClassDef

  44. def mkClassOf(tp: reflect.internal.SymbolTable.Type): reflect.internal.SymbolTable.Tree

    Apparently we smuggle a Type around as a Literal(Constant(tp)) and the implementation of Constant#tpe is such that x.

    Apparently we smuggle a Type around as a Literal(Constant(tp)) and the implementation of Constant#tpe is such that x.tpe becomes ClassType(value.asInstanceOf[Type]), i.e. java.lang.Class[Type]. Can't find any docs on how/why it's done this way. See ticket SI-490 for some interesting comments from lauri alanko suggesting that the type given by classOf[T] is too strong and should be weakened so as not to suggest that classOf[List[String]] is any different from classOf[List[Int]].

    !!! See deconstMap in Erasure for one bug this encoding has induced: I would be very surprised if there aren't more.

  45. def mkConstantZero(tp: reflect.internal.SymbolTable.Type): reflect.internal.SymbolTable.Constant

  46. def mkFor(enums: List[reflect.internal.SymbolTable.Tree], sugarBody: reflect.internal.SymbolTable.Tree)(implicit fresh: FreshNameCreator): reflect.internal.SymbolTable.Tree

    Create tree for for-comprehension <for (enums) do body> or <for (enums) yield body> where mapName and flatMapName are chosen corresponding to whether this is a for-do or a for-yield.

    Create tree for for-comprehension <for (enums) do body> or <for (enums) yield body> where mapName and flatMapName are chosen corresponding to whether this is a for-do or a for-yield. The creation performs the following rewrite rules:

    1.

    for (P <- G) E ==> G.foreach (P => E)

    Here and in the following (P => E) is interpreted as the function (P => E) if P is a variable pattern and as the partial function { case P => E } otherwise.

    2.

    for (P <- G) yield E ==> G.map (P => E)

    3.

    for (P_1 <- G_1; P_2 <- G_2; ...) ...

    > G_1.flatMap (P_1 => for (P_2 <- G_2; ...) ...)

    4.

    for (P <- G; E; ...) ...

    > for (P <- G.filter (P

    5. For N < MaxTupleArity:

    for (P_1 <- G; P_2 = E_2; val P_N = E_N; ...)

    > for (TupleN(P_1, P_2, ... P_N) <- for (x_1 @ P_1 <- G) yield { val x_2 @ P_2 = E_2 ... val x_N & P_N = E_N TupleN(x_1, ..., x_N) } ...)

    If any of the P_i are variable patterns, the corresponding x_i @ P_i' is not generated and the variable constituting P_i is used instead of x_i

    enums

    The enumerators in the for expression

  47. def mkFunctionTypeTree(argtpes: List[reflect.internal.SymbolTable.Tree], restpe: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Create a tree representing the function type (argtpes) => restpe

  48. def mkGenerator(pos: reflect.internal.SymbolTable.Position, pat: reflect.internal.SymbolTable.Tree, valeq: Boolean, rhs: reflect.internal.SymbolTable.Tree)(implicit fresh: FreshNameCreator): reflect.internal.SymbolTable.Tree

    Create tree for for-comprehension generator <val pat0 <- rhs0>

  49. def mkIsInstanceOf(value: reflect.internal.SymbolTable.Tree, tpe: reflect.internal.SymbolTable.Type, any: Boolean = true, wrapInApply: Boolean = true): reflect.internal.SymbolTable.Tree

    Builds an instance test with given value and type.

  50. def mkMethodCall(target: reflect.internal.SymbolTable.Tree, targs: List[reflect.internal.SymbolTable.Type], args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  51. def mkMethodCall(receiver: reflect.internal.SymbolTable.Tree, method: reflect.internal.SymbolTable.Symbol, targs: List[reflect.internal.SymbolTable.Type], args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  52. def mkMethodCall(receiver: reflect.internal.SymbolTable.Symbol, methodName: Name, args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  53. def mkMethodCall(target: reflect.internal.SymbolTable.Tree, args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  54. def mkMethodCall(method: reflect.internal.SymbolTable.Symbol, args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  55. def mkMethodCall(method: reflect.internal.SymbolTable.Symbol, targs: List[reflect.internal.SymbolTable.Type], args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

  56. def mkMethodCall(receiver: reflect.internal.SymbolTable.Symbol, methodName: Name, targs: List[reflect.internal.SymbolTable.Type], args: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

    A creator for method calls, e.

    A creator for method calls, e.g. fn[T1, T2, ...](v1, v2, ...) There are a number of variations.

    receiver

    symbol of the method receiver

    methodName

    name of the method to call

    targs

    type arguments (if Nil, no TypeApply node will be generated)

    args

    value arguments

    returns

    the newly created trees.

  57. def mkNamedArg(lhs: reflect.internal.SymbolTable.Tree, rhs: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

  58. def mkNamedArg(name: Name, tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Wrap an expression in a named argument.

  59. def mkNew(parents: List[reflect.internal.SymbolTable.Tree], self: reflect.internal.SymbolTable.ValDef, stats: List[reflect.internal.SymbolTable.Tree], npos: reflect.internal.SymbolTable.Position, cpos: reflect.internal.SymbolTable.Position): reflect.internal.SymbolTable.Tree

    Create positioned tree representing an object creation <new parents { stats }

    Create positioned tree representing an object creation <new parents { stats }

    npos

    the position of the new

    cpos

    the position of the anonymous class starting with parents

  60. def mkNil: reflect.internal.SymbolTable.Tree

    Builds a list with given head and tail.

  61. def mkNullaryCall(method: reflect.internal.SymbolTable.Symbol, targs: List[reflect.internal.SymbolTable.Type]): reflect.internal.SymbolTable.Tree

  62. def mkOr(tree1: reflect.internal.SymbolTable.Tree, tree2: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

  63. def mkPackageObject(defn: reflect.internal.SymbolTable.ModuleDef, pidPos: reflect.internal.SymbolTable.Position = NoPosition, pkgPos: reflect.internal.SymbolTable.Position = NoPosition): reflect.internal.SymbolTable.PackageDef

  64. def mkParents(ownerMods: reflect.internal.SymbolTable.Modifiers, parents: List[reflect.internal.SymbolTable.Tree], parentPos: reflect.internal.SymbolTable.Position = NoPosition): collection.immutable.List[reflect.internal.SymbolTable.Tree]

  65. def mkPatDef(mods: reflect.internal.SymbolTable.Modifiers, pat: reflect.internal.SymbolTable.Tree, rhs: reflect.internal.SymbolTable.Tree)(implicit fresh: FreshNameCreator): List[reflect.internal.SymbolTable.ValDef]

    Create tree for pattern definition <mods val pat0 = rhs>

  66. def mkPatDef(pat: reflect.internal.SymbolTable.Tree, rhs: reflect.internal.SymbolTable.Tree)(implicit fresh: FreshNameCreator): List[reflect.internal.SymbolTable.ValDef]

    Create tree for pattern definition <val pat0 = rhs>

  67. def mkRuntimeUniverseRef: reflect.internal.SymbolTable.Tree

  68. def mkSeqApply(arg: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Apply

  69. def mkSuperInitCall: reflect.internal.SymbolTable.Select

  70. def mkSyntheticParam(pname: reflect.internal.SymbolTable.TermName): reflect.internal.SymbolTable.ValDef

  71. def mkSyntheticUnit(): reflect.internal.SymbolTable.Tree

    Create a literal unit tree that is inserted by the compiler but not written by end user.

    Create a literal unit tree that is inserted by the compiler but not written by end user. It's important to distinguish the two so that quasiquotes can strip synthetic ones away.

  72. def mkTemplate(parents: List[reflect.internal.SymbolTable.Tree], self: reflect.internal.SymbolTable.ValDef, constrMods: reflect.internal.SymbolTable.Modifiers, vparamss: List[List[reflect.internal.SymbolTable.ValDef]], body: List[reflect.internal.SymbolTable.Tree], superPos: reflect.internal.SymbolTable.Position = NoPosition): reflect.internal.SymbolTable.Template

    Generates a template with constructor corresponding to

    Generates a template with constructor corresponding to

    constrmods (vparams1_) ... (vparams_n) preSuper { presupers } extends superclass(args_1) ... (args_n) with mixins { self => body }

    This gets translated to

    extends superclass with mixins { self => presupers' // presupers without rhs vparamss // abstract fields corresponding to value parameters def <init>(vparamss) { presupers super.<init>(args) } body }

  73. def mkTreeOrBlock(stats: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

    Create a block that wraps multiple statements but don't do any wrapping if there is just one statement.

    Create a block that wraps multiple statements but don't do any wrapping if there is just one statement. Used by quasiquotes, macro c.parse api and toolbox.

  74. def mkTuple(elems: List[reflect.internal.SymbolTable.Tree], flattenUnary: Boolean = true): reflect.internal.SymbolTable.Tree

    Builds a tuple

  75. def mkTupleType(elems: List[reflect.internal.SymbolTable.Tree], flattenUnary: Boolean = true): reflect.internal.SymbolTable.Tree

  76. def mkTypeApply(fun: reflect.internal.SymbolTable.Tree, targs: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

    Builds a type application node if args.

    Builds a type application node if args.nonEmpty, returns fun otherwise.

  77. def mkUnattributedRef(fullName: Name): reflect.internal.SymbolTable.RefTree

  78. def mkUnattributedRef(sym: reflect.internal.SymbolTable.Symbol): reflect.internal.SymbolTable.RefTree

  79. def mkUnchecked(expr: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

  80. def mkVisitor(cases: List[reflect.internal.SymbolTable.CaseDef], checkExhaustive: Boolean, prefix: String = "x$")(implicit fresh: FreshNameCreator): reflect.internal.SymbolTable.Tree

    Create visitor <x => x match cases>

  81. def mkZero(tp: reflect.internal.SymbolTable.Type): reflect.internal.SymbolTable.Tree

    Builds a tree representing an undefined local, as in var x: T = _ which is appropriate to the given Type.

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

    Definition Classes
    AnyRef
  83. object nme extends CommonNames with KeywordNames

    Definition Classes
    SymbolTableCompat
  84. final def notify(): Unit

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

    Definition Classes
    AnyRef
  86. object patvarTransformer extends reflect.internal.SymbolTable.Transformer

    Convert all occurrences of (lower-case) variables in a pattern as follows: x becomes x @ _ x: T becomes x @ (_: T)

  87. def rootId(name: Name): reflect.internal.SymbolTable.Select

  88. def rootScalaDot(name: Name): reflect.internal.SymbolTable.Select

  89. def scalaAnnotationDot(name: Name): reflect.internal.SymbolTable.Select

  90. def scalaAnyRefConstr: reflect.internal.SymbolTable.Select

  91. def scalaDot(name: Name): reflect.internal.SymbolTable.Select

  92. def scalaFunctionConstr(argtpes: List[reflect.internal.SymbolTable.Tree], restpe: reflect.internal.SymbolTable.Tree, abstractFun: Boolean = false): reflect.internal.SymbolTable.Tree

  93. def stabilize(tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Replaces tree type with a stable type if possible

  94. def stableTypeFor(tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Type

    Computes stable type for a tree if possible

  95. object symbolTable

    Definition Classes
    SymbolTableCompat
  96. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  97. def toString(): String

    Definition Classes
    AnyRef → Any
  98. object tpnme extends CommonNames

    Definition Classes
    SymbolTableCompat
  99. lazy val treeInfo: TreeInfo { val global: TreeGen.this.global.type }

    Definition Classes
    SymbolTableCompat
  100. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SymbolTableCompat

Inherited from AnyRef

Inherited from Any

Ungrouped