scala.tools.nsc.ast

TreeGen

abstract class TreeGen extends TreeGen with TreeDSL

XXX to resolve: TreeGen only assumes global is a SymbolTable, but TreeDSL at the moment expects a Global. Can we get by with SymbolTable?

Source
TreeGen.scala
Linear Supertypes
TreeDSL, TreeGen, AbsTreeGen, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TreeGen
  2. TreeDSL
  3. TreeGen
  4. AbsTreeGen
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringfmt
  2. by any2stringadd
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeGen()

Type Members

  1. class MatchMatcher extends AnyRef

Abstract Value Members

  1. abstract val global: Global

    Definition Classes
    TreeGenTreeDSLTreeGen → AbsTreeGen

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. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from TreeGen to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (TreeGen, B)

    Implicit information
    This member is added by an implicit conversion from TreeGen to ArrowAssoc[TreeGen] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  8. object CODE extends AnyRef

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def convertToSelectFromType(qual: Tree, origName: Name): Tree with Serializable

    Try to convert Select(qual, name) to a SelectFromTypeTree.

  12. def convertToTypeName(tree: Tree): Option[RefTree]

    Translate names in Select/Ident nodes to type names.

  13. def ensuring(cond: (TreeGen) ⇒ Boolean, msg: ⇒ Any): TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to Ensuring[TreeGen] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (TreeGen) ⇒ Boolean): TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to Ensuring[TreeGen] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to Ensuring[TreeGen] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to Ensuring[TreeGen] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  19. def evalOnce(expr: Tree, owner: Symbol, unit: CompilationUnit)(within: (() ⇒ Tree) ⇒ Tree): Tree

    Used in situations where you need to access value of an expression several times

  20. def evalOnceAll(exprs: List[Tree], owner: Symbol, unit: CompilationUnit)(within: (List[() ⇒ Tree]) ⇒ Tree): Tree

  21. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  22. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from TreeGen to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  23. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  24. def hasSynthCaseSymbol(t: Tree): Boolean

  25. def hashCode(): Int

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

    Definition Classes
    Any
  27. def maybeMkAsInstanceOf(tree: Tree, pt: Type, tpe: Type, beforeRefChecks: Boolean = false): Tree

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

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

    Definition Classes
    TreeGen
  28. def mkAnd(tree1: Tree, tree2: Tree): Tree

    Definition Classes
    TreeGen
  29. def mkAppliedTypeForCase(clazz: Symbol): Tree

  30. def mkApplyIfNeeded(qual: Tree): Tree

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

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

    Definition Classes
    TreeGen
  31. def mkAsInstanceOf(value: Tree, tpe: Type, any: Boolean = true, wrapInApply: Boolean = true): Tree

    Builds a cast with given value and type.

    Builds a cast with given value and type.

    Definition Classes
    TreeGen
  32. def mkAssignAndReturn(lhs: Symbol, rhs: Tree): Tree

  33. def mkAttributedIdent(sym: Symbol): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  34. def mkAttributedQualifier(tpe: Type, termSym: Symbol): 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.

    Definition Classes
    TreeGen → AbsTreeGen
  35. def mkAttributedQualifier(tpe: Type): 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.

    Definition Classes
    TreeGen → AbsTreeGen
  36. def mkAttributedRef(sym: Symbol): Tree

    Builds a reference to given symbol.

    Builds a reference to given symbol.

    Definition Classes
    TreeGen → AbsTreeGen
  37. def mkAttributedRef(pre: Type, sym: Symbol): Tree

    Builds a reference to given symbol with given stable prefix.

    Builds a reference to given symbol with given stable prefix.

    Definition Classes
    TreeGen → AbsTreeGen
  38. def mkAttributedSelect(qual: Tree, sym: Symbol): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  39. def mkAttributedStableRef(sym: Symbol): Tree

    Definition Classes
    TreeGen
  40. def mkAttributedStableRef(pre: Type, sym: Symbol): Tree

    Builds a reference with stable type to given symbol

    Builds a reference with stable type to given symbol

    Definition Classes
    TreeGen
  41. def mkAttributedThis(sym: Symbol): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  42. def mkAttributedTypeApply(target: Tree, method: Symbol, targs: List[Type]): Tree

    Definition Classes
    TreeGen
  43. def mkBindForCase(patVar: Symbol, clazz: Symbol, targs: List[Type]): Tree

  44. def mkCached(cvar: Symbol, expr: Tree): Tree

  45. def mkCachedModuleAccessDef(accessor: Symbol, mvar: Symbol): DefDef

  46. def mkCast(tree: Tree, pt: Type): Tree

    Cast tree to type pt by creating one of the calls of the form

    Cast tree to type pt by creating one of the calls of the form

    x.asInstanceOf[pt] up to phase uncurry x.asInstanceOf[pt]() if after uncurry but before erasure x.$asInstanceOf[pt]() if at or after erasure

  47. def mkCastArray(tree: Tree, elemtp: Type, pt: Type): Tree

    Generate a cast for tree Tree representing Array with elem type elemtp to expected type pt.

  48. def mkCheckInit(tree: Tree): Tree

  49. def mkClassOf(tp: Type): 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.

    Definition Classes
    TreeGen
  50. def mkConstantZero(tp: Type): Constant

    Definition Classes
    TreeGen
  51. def mkDoubleCheckedLocking(attrThis: Tree, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree

  52. def mkDoubleCheckedLocking(clazz: Symbol, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree

    Return a double-checked locking idiom around the syncBody tree.

    Return a double-checked locking idiom around the syncBody tree. It guards with cond and synchronizez on clazz.this. Additional statements can be included after initialization, (outside the synchronized block).

    The idiom works only if the condition is using a volatile field.

    See also

    http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

  53. def mkForwarder(target: Tree, vparamss: List[List[Symbol]]): Tree

    Make forwarder to method target, passing all parameters in params

  54. def mkIsInstanceOf(value: Tree, tpe: Type, any: Boolean = true, wrapInApply: Boolean = true): Tree

    Builds an instance test with given value and type.

    Builds an instance test with given value and type.

    Definition Classes
    TreeGen
  55. def mkManifestFactoryCall(full: Boolean, constructor: String, tparg: Type, args: List[Tree]): Tree

    A creator for a call to a scala.

    A creator for a call to a scala.reflect.Manifest or ClassManifest factory method.

    full

    full or partial manifest (target will be Manifest or ClassManifest)

    constructor

    name of the factory method (e.g. "classType")

    tparg

    the type argument

    args

    value arguments

    returns

    the tree

  56. def mkMethodCall(target: Tree, targs: List[Type], args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  57. def mkMethodCall(receiver: Tree, method: Symbol, targs: List[Type], args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  58. def mkMethodCall(receiver: Symbol, methodName: Name, args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  59. def mkMethodCall(target: Tree, args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  60. def mkMethodCall(method: Symbol, args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  61. def mkMethodCall(method: Symbol, targs: List[Type], args: List[Tree]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  62. def mkMethodCall(receiver: Symbol, methodName: Name, targs: List[Type], args: List[Tree]): 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.

    Definition Classes
    TreeGen → AbsTreeGen
  63. def mkModuleAccessDcl(accessor: Symbol): DefDef

  64. def mkModuleAccessDef(accessor: Symbol, msym: Symbol): DefDef

  65. def mkModuleVarDef(accessor: Symbol): ValDef

  66. def mkNewCons(head: Tree, tail: Tree): Tree

    Builds a list with given head and tail.

    Builds a list with given head and tail.

    Definition Classes
    TreeGen
  67. def mkNil: Tree

    Builds a list with given head and tail.

    Builds a list with given head and tail.

    Definition Classes
    TreeGen
  68. def mkNullaryCall(method: Symbol, targs: List[Type]): Tree

    Definition Classes
    TreeGen → AbsTreeGen
  69. def mkOr(tree1: Tree, tree2: Tree): Tree

    Definition Classes
    TreeGen
  70. def mkRuntimeCall(meth: Name, targs: List[Type], args: List[Tree]): Tree

  71. def mkRuntimeCall(meth: Name, args: List[Tree]): Tree

  72. def mkSoftRef(expr: Tree): Tree

  73. def mkSynchronized(monitor: Tree, body: Tree): Tree

    Make a synchronized block on 'monitor'.

  74. def mkSynthSwitchSelector(expr: Tree): Tree

  75. def mkSysErrorCall(message: String): Tree

  76. def mkTuple(elems: List[Tree]): Tree

    Builds a tuple

    Builds a tuple

    Definition Classes
    TreeGen
  77. def mkTypeApply(target: Tree, method: Symbol, targs: List[Type]): Tree

    Definition Classes
    TreeGen
  78. def mkTypeApply(fun: Tree, targs: List[Tree]): Tree

    Builds a type application node if args.

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

    Definition Classes
    TreeGen
  79. def mkUnattributedRef(sym: Symbol): Tree

    Builds an untyped reference to given symbol.

    Builds an untyped reference to given symbol.

    Definition Classes
    TreeGen
  80. def mkUnchecked(expr: Tree): Tree

  81. def mkUncheckedMatch(tree: Tree): Tree

  82. def mkWildcardImport(pkg: Symbol): Import

    Builds a fully attributed wildcard import node.

  83. def mkWrapArray(tree: Tree, elemtp: Type): Tree

    Applies a wrapArray call to an array, making it a WrappedArray.

    Applies a wrapArray call to an array, making it a WrappedArray. Don't let a reference type parameter be inferred, in case it's a singleton: apply the element type directly.

  84. def mkZero(tp: Type): Tree

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

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

    Definition Classes
    TreeGen
  85. def mkZeroContravariantAfterTyper(tp: Type): Tree

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

    Definition Classes
    AnyRef
  87. def newModule(accessor: Symbol, tpe: Type): Tree

  88. final def notify(): Unit

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

    Definition Classes
    AnyRef
  90. def paramToArg(vparam: ValDef): Tree with Serializable

  91. def paramToArg(vparam: Symbol): Tree with Serializable

  92. def productConstr: Select

    Definition Classes
    TreeGen
  93. def rootId(name: Name): Select

    Definition Classes
    TreeGen
  94. def rootScalaDot(name: Name): Select

    Definition Classes
    TreeGen
  95. def scalaAnyRefConstr: Select

    Definition Classes
    TreeGen
  96. def scalaDot(name: Name): Select

    Definition Classes
    TreeGen
  97. def scalaFunctionConstr(argtpes: List[Tree], restpe: Tree, abstractFun: Boolean = false): Tree

    Definition Classes
    TreeGen
  98. def scalaUnitConstr: Select

    Definition Classes
    TreeGen
  99. val self: Any

    Implicit information
    This member is added by an implicit conversion from TreeGen to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
  100. val self: Any

    Implicit information
    This member is added by an implicit conversion from TreeGen to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  101. def serializableConstr: Select

    Definition Classes
    TreeGen
  102. def stabilize(tree: Tree): Tree

    Replaces tree type with a stable type if possible

    Replaces tree type with a stable type if possible

    Definition Classes
    TreeGen
  103. def stableTypeFor(tree: Tree): Option[Type]

    Computes stable type for a tree if possible

    Computes stable type for a tree if possible

    Definition Classes
    TreeGen
  104. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  105. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  109. def wildcardStar(tree: Tree): Typed

  110. def [B](y: B): (TreeGen, B)

    Implicit information
    This member is added by an implicit conversion from TreeGen to ArrowAssoc[TreeGen] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def x: TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to ArrowAssoc[TreeGen] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: TreeGen

    Implicit information
    This member is added by an implicit conversion from TreeGen to Ensuring[TreeGen] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from TreeDSL

Inherited from TreeGen

Inherited from AbsTreeGen

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringfmt from TreeGen to StringFormat

Inherited by implicit conversion any2stringadd from TreeGen to StringAdd

Inherited by implicit conversion any2ArrowAssoc from TreeGen to ArrowAssoc[TreeGen]

Inherited by implicit conversion any2Ensuring from TreeGen to Ensuring[TreeGen]