scala.reflect.internal

TreeGen

abstract class TreeGen extends AnyRef

Source
TreeGen.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. TreeGen
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeGen()

Abstract Value Members

  1. abstract val global: SymbolTable

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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def getClass(): Class[_]

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

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

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

  15. def mkAnd(tree1: Tree, tree2: Tree): Tree

  16. def mkApplyIfNeeded(qual: Tree): Tree

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

  17. def mkAsInstanceOf(value: Tree, tpe: Type, any: Boolean = true, wrapInApply: Boolean = true): Tree

    Builds a cast with given value and type.

  18. def mkAttributedIdent(sym: Symbol): Tree

  19. 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.

  20. 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.

  21. def mkAttributedRef(sym: Symbol): Tree

    Builds a reference to given symbol.

  22. def mkAttributedRef(pre: Type, sym: Symbol): Tree

    Builds a reference to given symbol with given stable prefix.

  23. def mkAttributedSelect(qual: Tree, sym: Symbol): Tree

  24. def mkAttributedStableRef(sym: Symbol): Tree

  25. def mkAttributedStableRef(pre: Type, sym: Symbol): Tree

    Builds a reference with stable type to given symbol

  26. def mkAttributedThis(sym: Symbol): Tree

  27. def mkAttributedTypeApply(target: Tree, method: Symbol, targs: List[Type]): Tree

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

    Cast tree to type pt

  29. 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.

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

    Builds an instance test with given value and type.

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

  32. def mkMethodCall(receiver: Tree, method: Symbol, targs: List[Type], args: List[Tree]): Tree

  33. def mkMethodCall(receiver: Symbol, methodName: Name, args: List[Tree]): Tree

  34. def mkMethodCall(target: Tree, args: List[Tree]): Tree

  35. def mkMethodCall(method: Symbol, args: List[Tree]): Tree

  36. def mkMethodCall(method: Symbol, targs: List[Type], args: List[Tree]): Tree

  37. 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.

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

    Builds a list with given head and tail.

  39. def mkNil: Tree

    Builds a list with given head and tail.

  40. def mkOr(tree1: Tree, tree2: Tree): Tree

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

    Builds a tuple

  42. def mkTypeApply(target: Tree, method: Symbol, targs: List[Type]): Tree

  43. 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.

  44. def mkUnattributedRef(sym: Symbol): Tree

    Builds an untyped reference to given symbol.

  45. def mkZero(tp: Type): Tree

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

  46. def mkZeroContravariantAfterTyper(tp: Type): Tree

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

    Definition Classes
    AnyRef
  48. final def notify(): Unit

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

    Definition Classes
    AnyRef
  50. def productConstr: Select

  51. def rootId(name: Name): Select

  52. def rootScalaDot(name: Name): Select

  53. def scalaAnyRefConstr: Select

  54. def scalaDot(name: Name): Select

  55. def scalaFunctionConstr(argtpes: List[Tree], restpe: Tree, abstractFun: Boolean = false): Tree

  56. def scalaScalaObjectConstr: Select

  57. def scalaUnitConstr: Select

  58. def serializableConstr: Select

  59. def stabilize(tree: Tree): Tree

    Replaces tree type with a stable type if possible

  60. def stableTypeFor(tree: Tree): Option[Type]

    Computes stable type for a tree if possible

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

    Definition Classes
    AnyRef
  62. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any