scala.tools.nsc.Global

# gen

###
Related Doc: package Global

#### object gen extends ast.TreeGen

Tree generation, usually based on existing symbols.

Definition Classes
  Global → SymbolTable
Source
  Global.scala

Linear Supertypes
ast.TreeGen, TreeDSL, reflect.internal.TreeGen, AnyRef, Any
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. gen
2. TreeGen
3. TreeDSL
4. TreeGen
5. AnyRef
6. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Type Members

1. #### class GetVarTraverser extends reflect.internal.SymbolTable.Traverser

   Definition Classes
     TreeGen

### Value Members

1. #### final def !=(arg0: Any): Boolean

   Test two objects for inequality.

   Test two objects for inequality.

   returns

     `true` if !(this == that), false otherwise.

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Equivalent to `x.hashCode` except for boxed numeric types and `null`.

   Equivalent to `x.hashCode` except for boxed numeric types and `null`. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them. For `null` returns a hashcode where `null.hashCode` throws a `NullPointerException`.

   returns

     a hash value consistent with ==

   Definition Classes
     AnyRef → Any

3. #### final def ==(arg0: Any): Boolean

   The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.

   The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.

   returns

     `true` if the receiver object is equivalent to the argument; `false` otherwise.

   Definition Classes
     AnyRef → Any

4. #### object CODE

   Definition Classes
     TreeDSL

5. #### object Filter

   Definition Classes
     TreeGen

6. #### object Yield

   Definition Classes
     TreeGen

7. #### final def asInstanceOf[T0]: T0

   Cast the receiver object to be of type `T0`.

   Cast the receiver object to be of type `T0`.

   Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression `1.asInstanceOf[String]` will throw a `ClassCastException` at runtime, while the expression `List(1).asInstanceOf[List[String]]` will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.

   returns

     the receiver object.

   Definition Classes
     Any
   Exceptions thrown

     `ClassCastException` if the receiver object is not an instance of the erasure of type `T0`.

8. #### def clone(): AnyRef

   Create a copy of the receiver object.

   Create a copy of the receiver object.

   The default implementation of the `clone` method is platform dependent.

   returns

     a copy of the receiver object.

   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )
   Note

     not specified by SLS as a member of AnyRef

9. #### def convertToSelectFromType(qual: Global.Tree, origName: Global.Name): Global.Tree with Serializable

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

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

   Definition Classes
     TreeGen

10. #### def convertToTypeName(tree: Global.Tree): Option[Global.RefTree]

    Translate names in Select/Ident nodes to type names.

    Translate names in Select/Ident nodes to type names.

    Definition Classes
      TreeGen

11. #### final def eq(arg0: AnyRef): Boolean

    Tests whether the argument (`that`) is a reference to the receiver object (`this`).

    Tests whether the argument (`that`) is a reference to the receiver object (`this`).

    The `eq` method implements an equivalence relation on non-null instances of `AnyRef`, and has three additional properties:

    - It is consistent: for any non-null instances `x` and `y` of type `AnyRef`, multiple invocations of `x.eq(y)` consistently returns `true` or consistently returns `false`.
    - For any non-null instance `x` of type `AnyRef`, `x.eq(null)` and `null.eq(x)` returns `false`.
    - `null.eq(null)` returns `true`.

    When overriding the `equals` or `hashCode` methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (`o1 eq o2`), they should be equal to each other (`o1 == o2`) and they should hash to the same value (`o1.hashCode == o2.hashCode`).

    returns

      `true` if the argument is a reference to the receiver object; `false` otherwise.

    Definition Classes
      AnyRef

12. #### def equals(arg0: Any): Boolean

    The equality method for reference types.

    The equality method for reference types. Default implementation delegates to `eq`.

    See also `equals` in scala.Any.

    returns

      `true` if the receiver object is equivalent to the argument; `false` otherwise.

    Definition Classes
      AnyRef → Any

13. #### def evalOnce(expr: Global.Tree, owner: Global.Symbol, unit: Global.CompilationUnit)(within: (() ⇒ Global.Tree) ⇒ Global.Tree): Global.Tree

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

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

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

15. #### def finalize(): Unit

    Called by the garbage collector on the receiver object when there are no more references to the object.

    Called by the garbage collector on the receiver object when there are no more references to the object.

    The details of when and if the `finalize` method is invoked, as well as the interaction between `finalize` and non-local returns and exceptions, are all platform dependent.

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
    Note

      not specified by SLS as a member of AnyRef

16. #### final def getClass(): Class[_]

    A representation that corresponds to the dynamic class of the receiver object.

    A representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

      a representation that corresponds to the dynamic class of the receiver object.

    Definition Classes
      AnyRef → Any
    Note

      not specified by SLS as a member of AnyRef

17. #### val global: Global.this.type

    Definition Classes
      gen → TreeGen → TreeDSL → TreeGen

18. #### def hashCode(): Int

    The hashCode method for reference types.

    The hashCode method for reference types. See hashCode in scala.Any.

    returns

      the hash code value for this object.

    Definition Classes
      AnyRef → Any

19. #### final def isInstanceOf[T0]: Boolean

    Test whether the dynamic type of the receiver object is `T0`.

    Test whether the dynamic type of the receiver object is `T0`.

    Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression `1.isInstanceOf[String]` will return `false`, while the expression `List(1).isInstanceOf[List[String]]` will return `true`. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.

    returns

      `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.

    Definition Classes
      Any

20. #### def maybeMkAsInstanceOf(tree: Global.Tree, pt: Global.Type, tpe: Global.Type, beforeRefChecks: Boolean): Global.Tree

    Definition Classes
      TreeGen

21. #### def mkAnd(tree1: Global.Tree, tree2: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

22. #### def mkAnonymousNew(stats: List[Global.Tree]): Global.Tree

    Creates a tree representing new Object { stats }.

    Creates a tree representing new Object { stats }. To make sure an anonymous subclass of Object is created, if there are no stats, a () is added.

    Definition Classes
      TreeGen

23. #### def mkAppliedTypeForCase(clazz: Global.Symbol): Global.Tree

    Definition Classes
      TreeGen

24. #### def mkAppliedTypeTree(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

25. #### def mkApplyIfNeeded(qual: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

26. #### def mkAsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree

    Definition Classes
      TreeGen

27. #### def mkAssign(lhs: Global.Tree, rhs: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

28. #### def mkAssignAndReturn(lhs: Global.Symbol, rhs: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

29. #### def mkAttributedCast(tree: Global.Tree, pt: Global.Type): Global.Tree

30. #### def mkAttributedIdent(sym: Global.Symbol): Global.RefTree

    Definition Classes
      TreeGen

31. #### def mkAttributedQualifier(tpe: Global.Type, termSym: Global.Symbol): Global.Tree

    Definition Classes
      TreeGen

32. #### def mkAttributedQualifier(tpe: Global.Type): Global.Tree

    Definition Classes
      TreeGen

33. #### def mkAttributedRef(sym: Global.Symbol): Global.RefTree

    Definition Classes
      TreeGen

34. #### def mkAttributedRef(pre: Global.Type, sym: Global.Symbol): Global.RefTree

    Definition Classes
      TreeGen

35. #### def mkAttributedSelect(qual: Global.Tree, sym: Global.Symbol): Global.RefTree

    Definition Classes
      TreeGen

36. #### def mkAttributedStableRef(sym: Global.Symbol): Global.Tree

    Definition Classes
      TreeGen

37. #### def mkAttributedStableRef(pre: Global.Type, sym: Global.Symbol): Global.Tree

    Definition Classes
      TreeGen

38. #### def mkAttributedThis(sym: Global.Symbol): Global.This

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

40. #### def mkBindForCase(patVar: Global.Symbol, clazz: Global.Symbol, targs: List[Global.Type]): Global.Tree

    Definition Classes
      TreeGen

41. #### def mkBlock(stats: List[Global.Tree], doFlatten: Boolean): Global.Tree

    Definition Classes
      TreeGen

42. #### def mkCast(tree: Global.Tree, pt: Global.Type): Global.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

    Definition Classes
      TreeGen → TreeGen

43. #### def mkCastArray(tree: Global.Tree, elemtp: Global.Type, pt: Global.Type): Global.Tree

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

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

    Definition Classes
      TreeGen

44. #### def mkCastPreservingAnnotations(tree: Global.Tree, pt: Global.Type): Global.Typed

    Definition Classes
      TreeGen

45. #### def mkCheckIfRefutable(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree

    Definition Classes
      TreeGen

46. #### def mkClassDef(mods: Global.Modifiers, name: Global.TypeName, tparams: List[Global.TypeDef], templ: Global.Template): Global.ClassDef

    Definition Classes
      TreeGen

47. #### def mkClassOf(tp: Global.Type): Global.Tree

    Definition Classes
      TreeGen

48. #### def mkConstantZero(tp: Global.Type): Global.Constant

    Definition Classes
      TreeGen

49. #### def mkFor(enums: List[Global.Tree], sugarBody: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree

    Definition Classes
      TreeGen

50. #### def mkForwarder(target: Global.Tree, vparamss: List[List[Global.Symbol]]): Global.Tree

    Make forwarder to method `target`, passing all parameters in `params`

    Make forwarder to method `target`, passing all parameters in `params`

    Definition Classes
      TreeGen

51. #### def mkFunctionTypeTree(argtpes: List[Global.Tree], restpe: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

52. #### def mkGenerator(pos: Global.Position, pat: Global.Tree, valeq: Boolean, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree

    Definition Classes
      TreeGen

53. #### def mkImport(qualSym: Global.Symbol, name: Global.Name, toName: Global.Name): Global.Import

    Builds a fully attributed, synthetic import node.

    Builds a fully attributed, synthetic import node. import `qualSym`.{`name` => `toName`}

    Definition Classes
      TreeGen

54. #### def mkIsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree

    Definition Classes
      TreeGen

55. #### def mkManifestFactoryCall(full: Boolean, constructor: String, tparg: Global.Type, args: List[Global.Tree]): Global.Tree

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

    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

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

59. #### def mkMethodCall(target: Global.Tree, args: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

60. #### def mkMethodCall(method: Global.Symbol, args: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

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

    Definition Classes
      TreeGen

62. #### def mkMethodCall(receiver: Global.Symbol, methodName: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

63. #### def mkMethodFromFunction(localTyper: (analyzer)#Typer)(fun: Global.Function, owner: Global.Symbol, name: Global.TermName, additionalFlags: Global.FlagSet = NoFlags): Global.DefDef

    Create a method based on a Function

    Create a method based on a Function

    Used both to under `-Ydelambdafy:method` create a lifted function and under `-Ydelambdafy:inline` to create the apply method on the anonymous class.

    It creates a method definition with value params cloned from the original lambda. Then it calls a supplied function to create the body and types the result. Finally everything is wrapped up in a DefDef

    owner

      The owner for the new method

    name

      name for the new method

    additionalFlags

      flags to be put on the method in addition to FINAL

    Definition Classes
      TreeGen

64. #### def mkNamedArg(lhs: Global.Tree, rhs: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

65. #### def mkNamedArg(name: Global.Name, tree: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

66. #### def mkNew(parents: List[Global.Tree], self: Global.ValDef, stats: List[Global.Tree], npos: Global.Position, cpos: Global.Position): Global.Tree

    Definition Classes
      TreeGen

67. #### def mkNil: Global.Tree

    Definition Classes
      TreeGen

68. #### def mkNullaryCall(method: Global.Symbol, targs: List[Global.Type]): Global.Tree

    Definition Classes
      TreeGen

69. #### def mkOr(tree1: Global.Tree, tree2: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

70. #### def mkPackageObject(defn: Global.ModuleDef, pidPos: Global.Position, pkgPos: Global.Position): Global.PackageDef

    Definition Classes
      TreeGen

71. #### def mkParents(ownerMods: Global.Modifiers, parents: List[Global.Tree], parentPos: Global.Position): collection.immutable.List[Global.Tree]

    Definition Classes
      TreeGen

72. #### def mkPatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]

    Definition Classes
      TreeGen

73. #### def mkPatDef(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]

    Definition Classes
      TreeGen

74. #### def mkRuntimeCall(meth: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

75. #### def mkRuntimeCall(meth: Global.Name, args: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

76. #### def mkRuntimeUniverseRef: Global.Tree

    Definition Classes
      TreeGen

77. #### def mkSeqApply(arg: Global.Tree): Global.Apply

    Definition Classes
      TreeGen

78. #### def mkSoftRef(expr: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

79. #### def mkSuperInitCall: Global.Select

    Definition Classes
      TreeGen

80. #### def mkSynchronized(monitor: Global.Tree, body: Global.Tree): Global.Tree

    Make a synchronized block on 'monitor'.

    Make a synchronized block on 'monitor'.

    Definition Classes
      TreeGen

81. #### def mkSynchronizedCheck(attrThis: Global.Tree, cond: Global.Tree, syncBody: List[Global.Tree], stats: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

82. #### def mkSynchronizedCheck(clazz: Global.Symbol, cond: Global.Tree, syncBody: List[Global.Tree], stats: List[Global.Tree]): Global.Tree

    Return the synchronized part of the double-checked locking idiom around the syncBody tree.

    Return the synchronized part of the double-checked locking idiom around the syncBody tree. It guards with `cond` and synchronizes 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.

    Definition Classes
      TreeGen
    See also

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

83. #### def mkSyntheticParam(pname: Global.TermName): Global.ValDef

    Definition Classes
      TreeGen

84. #### def mkSyntheticUnit(): Global.Literal

    Definition Classes
      TreeGen

85. #### def mkSysErrorCall(message: String): Global.Tree

    Definition Classes
      TreeGen

86. #### def mkTemplate(parents: List[Global.Tree], self: Global.ValDef, constrMods: Global.Modifiers, vparamss: List[List[Global.ValDef]], body: List[Global.Tree], superPos: Global.Position): Global.Template

    Definition Classes
      TreeGen

87. #### def mkTreeOrBlock(stats: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

88. #### def mkTuple(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree

    Definition Classes
      TreeGen

89. #### def mkTupleType(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree

    Definition Classes
      TreeGen

90. #### def mkTypeApply(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree

    Definition Classes
      TreeGen

91. #### def mkUnattributedRef(fullName: Global.Name): Global.RefTree

    Definition Classes
      TreeGen

92. #### def mkUnattributedRef(sym: Global.Symbol): Global.RefTree

    Definition Classes
      TreeGen

93. #### def mkUnchecked(expr: Global.Tree): Global.Tree

    Definition Classes
      TreeGen

94. #### def mkVisitor(cases: List[Global.CaseDef], checkExhaustive: Boolean, prefix: String)(implicit fresh: FreshNameCreator): Global.Tree

    Definition Classes
      TreeGen

95. #### def mkWildcardImport(pkg: Global.Symbol): Global.Import

    Builds a fully attributed, synthetic wildcard import node.

    Builds a fully attributed, synthetic wildcard import node.

    Definition Classes
      TreeGen

96. #### def mkWrapArray(tree: Global.Tree, elemtp: Global.Type): Global.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.

    Definition Classes
      TreeGen

97. #### def mkZero(tp: Global.Type): Global.Tree

    Definition Classes
      TreeGen

98. #### final def ne(arg0: AnyRef): Boolean

    Equivalent to `!(this eq that)`.

    Equivalent to `!(this eq that)`.

    returns

      `true` if the argument is not a reference to the receiver object; `false` otherwise.

    Definition Classes
      AnyRef

99. #### def newModule(accessor: Global.Symbol, tpe: Global.Type): Global.Tree

    Definition Classes
      TreeGen

100. #### final def notify(): Unit

     Wakes up a single thread that is waiting on the receiver object's monitor.

     Wakes up a single thread that is waiting on the receiver object's monitor.

     Definition Classes
       AnyRef
     Note

       not specified by SLS as a member of AnyRef

101. #### final def notifyAll(): Unit

     Wakes up all threads that are waiting on the receiver object's monitor.

     Wakes up all threads that are waiting on the receiver object's monitor.

     Definition Classes
       AnyRef
     Note

       not specified by SLS as a member of AnyRef

102. #### def paramToArg(arg: Global.Ident, isRepeatedParam: Boolean): Global.Tree

     Definition Classes
       TreeGen

103. #### def paramToArg(vparam: Global.ValDef): Global.Tree

     Definition Classes
       TreeGen

104. #### def paramToArg(vparam: Global.Symbol): Global.Tree

     Definition Classes
       TreeGen

105. #### object patvarTransformer extends reflect.internal.SymbolTable.Transformer

     Definition Classes
       TreeGen

106. #### def rootId(name: Global.Name): Global.Select

     Definition Classes
       TreeGen

107. #### def rootScalaDot(name: Global.Name): Global.Select

     Definition Classes
       TreeGen

108. #### def scalaAnnotationDot(name: Global.Name): Global.Select

     Definition Classes
       TreeGen

109. #### def scalaAnyRefConstr: Global.Select

     Definition Classes
       TreeGen

110. #### def scalaDot(name: Global.Name): Global.Select

     Definition Classes
       TreeGen

111. #### def scalaFunctionConstr(argtpes: List[Global.Tree], restpe: Global.Tree, abstractFun: Boolean): Global.Tree

     Definition Classes
       TreeGen

112. #### def stabilize(tree: Global.Tree): Global.Tree

     Definition Classes
       TreeGen

113. #### def stableTypeFor(tree: Global.Tree): Global.Type

     Definition Classes
       TreeGen

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

     Definition Classes
       AnyRef

115. #### def toString(): String

     Creates a String representation of this object.

     Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.

     returns

       a String representation of the object.

     Definition Classes
       AnyRef → Any

116. #### final def wait(): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

117. #### final def wait(arg0: Long, arg1: Int): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

118. #### final def wait(arg0: Long): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

119. #### def wildcardStar(tree: Global.Tree): Global.Typed

     Definition Classes
       TreeGen

### Inherited from ast.TreeGen

### Inherited from TreeDSL

### Inherited from reflect.internal.TreeGen

### Inherited from AnyRef

### Inherited from Any

### Ungrouped