Scala Compiler 2.13.16 - scala.tools.nsc.ast.TreeGen
Keywords: Scala Compiler 2.13.16 scala.tools.nsc.ast.TreeGen

Scala Compiler2.13.16 < Back


# Packages

-  package root

  The Scala compiler and reflection APIs.

  The Scala compiler and reflection APIs.

  Definition Classes
    root
-  package scala
  Definition Classes
    root
-  package tools
  Definition Classes
    scala
-  package nsc
  Definition Classes
    tools
-  package ast
  Definition Classes
    nsc
-  package parser
  Definition Classes
    ast
- DocComments
- NodePrinters
- Positions
- Printers
- TreeBrowsers
- TreeDSL
- TreeGen
- TreeInfo
- Trees

c

scala.tools.nsc.ast

# TreeGen

###

#### abstract class TreeGen extends reflect.internal.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, reflect.internal.TreeGen, AnyRef, Any
Known Subclasses
gen
Type Hierarchy

Ordering

1. Alphabetic
2. By Inheritance

Inherited

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

Implicitly

1. by any2stringadd
2. by StringFormat
3. by Ensuring
4. by ArrowAssoc

1. Hide All
2. Show All

Visibility

1. Public
2. Protected

### Instance Constructors

1.  new TreeGen()

### Type Members

1.  class GetVarTraverser extends reflect.internal.SymbolTable.Traverser
   Definition Classes
     TreeGen
2.  class PatvarTransformer extends reflect.internal.SymbolTable.Transformer
   Definition Classes
     TreeGen

### Abstract Value Members

1.  abstract val global: Global
   Definition Classes
     TreeGen → TreeDSL → TreeGen

### Concrete Value Members

1.  object CODE
   Definition Classes
     TreeDSL
2.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
3.  final def ##: Int
   Definition Classes
     AnyRef → Any
4.  def +(other: String): String
   Implicit
     This member is added by an implicit conversion from TreeGen toany2stringadd[TreeGen] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd
5.  def ->[B](y: B): (TreeGen, B)
   Implicit
     This member is added by an implicit conversion from TreeGen toArrowAssoc[TreeGen] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @inline()
6.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
7.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
8.  def clone(): AnyRef
   Attributes
     protected[lang]
   Definition Classes
     AnyRef
   Annotations
     @throws(classOf[java.lang.CloneNotSupportedException]) @native()
9.  def convertToSelectFromType(qual: Global.Tree, origName: Global.Name): Global.Tree with java.io.Serializable

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

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

    Translate names in Select/Ident nodes to type names.

11.  def ensuring(cond: (TreeGen) => Boolean, msg: => Any): TreeGen
    Implicit
      This member is added by an implicit conversion from TreeGen toEnsuring[TreeGen] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
12.  def ensuring(cond: (TreeGen) => Boolean): TreeGen
    Implicit
      This member is added by an implicit conversion from TreeGen toEnsuring[TreeGen] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
13.  def ensuring(cond: Boolean, msg: => Any): TreeGen
    Implicit
      This member is added by an implicit conversion from TreeGen toEnsuring[TreeGen] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
14.  def ensuring(cond: Boolean): TreeGen
    Implicit
      This member is added by an implicit conversion from TreeGen toEnsuring[TreeGen] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
15.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
16.  def equals(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef → Any
17.  def evalOnce(expr: Global.Tree, owner: Global.Symbol, fresh: FreshNameCreator)(within: (() => Global.Tree) => Global.Tree): Global.Tree
18.  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

19.  def evalOnceAll(exprs: List[Global.Tree], owner: Global.Symbol, fresh: FreshNameCreator)(within: (List[() => Global.Tree]) => Global.Tree): Global.Tree
20.  def evalOnceAll(exprs: List[Global.Tree], owner: Global.Symbol, unit: Global.CompilationUnit)(within: (List[() => Global.Tree]) => Global.Tree): Global.Tree
21.  def expandFunction(localTyper: (analyzer)#Typer)(fun: Global.Function, inConstructorFlag: Long): Global.Tree
22.  def finalize(): Unit
    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.Throwable])
23.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
24.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
25.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
26.  def isPatVarWarnable: Boolean
    Definition Classes
      TreeGen → TreeGen
27.  def isVarDefWarnable: Boolean
    Definition Classes
      TreeGen → TreeGen
28.  def maybeMkAsInstanceOf(tree: Global.Tree, pt: Global.Type, tpe: Global.Type, beforeRefChecks: Boolean): Global.Tree
    Definition Classes
      TreeGen
29.  def mkAnd(tree1: Global.Tree, tree2: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
30.  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.

31.  def mkAppliedTypeForCase(clazz: Global.Symbol): Global.Tree
32.  def mkAppliedTypeTree(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
33.  def mkApplyIfNeeded(qual: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
34.  def mkAsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree
    Definition Classes
      TreeGen
35.  def mkAssign(lhs: Global.Tree, rhs: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
36.  def mkAssignAndReturn(lhs: Global.Symbol, rhs: Global.Tree): Global.Tree
37.  def mkAttributedIdent(sym: Global.Symbol): Global.RefTree
    Definition Classes
      TreeGen
38.  def mkAttributedQualifier(tpe: Global.Type, termSym: Global.Symbol): Global.Tree
    Definition Classes
      TreeGen
39.  def mkAttributedQualifier(tpe: Global.Type): Global.Tree
    Definition Classes
      TreeGen
40.  final def mkAttributedQualifierIfPossible(prefix: Global.Type): Option[Global.Tree]
    Definition Classes
      TreeGen
    Annotations
      @tailrec()
41.  def mkAttributedRef(sym: Global.Symbol): Global.RefTree
    Definition Classes
      TreeGen
42.  def mkAttributedRef(pre: Global.Type, sym: Global.Symbol): Global.RefTree
    Definition Classes
      TreeGen
43.  def mkAttributedSelect(qual: Global.Tree, sym: Global.Symbol): Global.RefTree
    Definition Classes
      TreeGen
44.  def mkAttributedStableRef(sym: Global.Symbol): Global.Tree
    Definition Classes
      TreeGen
45.  def mkAttributedStableRef(pre: Global.Type, sym: Global.Symbol): Global.Tree
    Definition Classes
      TreeGen
46.  def mkAttributedThis(sym: Global.Symbol): Global.This
    Definition Classes
      TreeGen
47.  def mkAttributedTypeApply(target: Global.Tree, method: Global.Symbol, targs: List[Global.Type]): Global.Tree
    Definition Classes
      TreeGen
48.  def mkBindForCase(patVar: Global.Symbol, clazz: Global.Symbol, targs: List[Global.Type]): Global.Tree
49.  def mkBlock(stats: List[Global.Tree], doFlatten: Boolean): Global.Tree
    Definition Classes
      TreeGen
50.  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
51.  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.

52.  def mkCastPreservingAnnotations(tree: Global.Tree, pt: Global.Type): Global.Typed
53.  def mkCheckIfRefutable(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
    Definition Classes
      TreeGen
54.  def mkClassDef(mods: Global.Modifiers, name: Global.TypeName, tparams: List[Global.TypeDef], templ: Global.Template): Global.ClassDef
    Definition Classes
      TreeGen
55.  def mkClassOf(tp: Global.Type): Global.Tree
    Definition Classes
      TreeGen
56.  def mkConstantZero(tp: Global.Type): Global.Constant
    Definition Classes
      TreeGen
57.  def mkFor(enums: List[Global.Tree], sugarBody: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
    Definition Classes
      TreeGen
58.  def mkForwarder(target: Global.Tree, vparamss: List[List[Global.Symbol]]): Global.Tree

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

59.  def mkFunctionTypeTree(argtpes: List[Global.Tree], restpe: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
60.  def mkGenerator(pos: Global.Position, pat: Global.Tree, valeq: Boolean, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
    Definition Classes
      TreeGen
61.  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`}

62.  def mkImportFromSelector(qualSym: Global.Symbol, selector: List[Global.ImportSelector]): Global.Import
63.  def mkIsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree
    Definition Classes
      TreeGen
64.  def mkLiftedFunctionBodyMethod(localTyper: (analyzer)#Typer)(owner: Global.Symbol, fun: Global.Function): Global.DefDef
65.  def mkLiteralUnit: Global.Literal
    Definition Classes
      TreeGen
66.  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

67.  def mkMethodCall(target: Global.Tree, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
68.  def mkMethodCall(receiver: Global.Tree, method: Global.Symbol, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
69.  def mkMethodCall(receiver: Global.Symbol, methodName: Global.Name, args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
70.  def mkMethodCall(target: Global.Tree, args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
71.  def mkMethodCall(method: Global.Symbol, args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
72.  def mkMethodCall(method: Global.Symbol, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
73.  def mkMethodCall(receiver: Global.Symbol, methodName: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
74.  def mkMethodFromFunction(localTyper: (analyzer)#Typer)(owner: Global.Symbol, fun: Global.Function): Global.DefDef
75.  def mkNamedArg(lhs: Global.Tree, rhs: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
76.  def mkNamedArg(name: Global.Name, tree: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
77.  def mkNew(parents: List[Global.Tree], self: Global.ValDef, stats: List[Global.Tree], npos: Global.Position, cpos: Global.Position): Global.Tree
    Definition Classes
      TreeGen
78.  def mkNil: Global.Tree
    Definition Classes
      TreeGen
79.  def mkNullaryCall(method: Global.Symbol, targs: List[Global.Type]): Global.Tree
    Definition Classes
      TreeGen
80.  def mkOr(tree1: Global.Tree, tree2: Global.Tree): Global.Tree
    Definition Classes
      TreeGen
81.  def mkPackageObject(defn: Global.ModuleDef, pidPos: Global.Position, pkgPos: Global.Position): Global.PackageDef
    Definition Classes
      TreeGen
82.  def mkParents(ownerMods: Global.Modifiers, parents: List[Global.Tree], parentPos: Global.Position): collection.immutable.List[Global.Tree]
    Definition Classes
      TreeGen
83.  def mkPatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree, rhsPos: Global.Position)(implicit fresh: FreshNameCreator): List[Global.ValDef]
    Definition Classes
      TreeGen
84.  def mkPatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]
    Definition Classes
      TreeGen
85.  def mkPatDef(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]
    Definition Classes
      TreeGen
86.  def mkRuntimeCall(meth: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
87.  def mkRuntimeCall(meth: Global.Name, args: List[Global.Tree]): Global.Tree
88.  def mkRuntimeUniverseRef: Global.Tree
    Definition Classes
      TreeGen
89.  def mkSeqApply(arg: Global.Tree): Global.Apply
    Definition Classes
      TreeGen
90.  def mkSoftRef(expr: Global.Tree): Global.Tree
91.  final def mkStatic(orig: Global.DefDef, newName: Global.Name, maybeClone: (Global.Symbol) => Global.Symbol): Global.DefDef

    Create a new `DefDef` based on `orig` with an explicit self parameter.

    Create a new `DefDef` based on `orig` with an explicit self parameter.

    Details:

    - Must by run after erasure
    - If `maybeClone` is the identity function, this runs "in place" and mutates the symbol of `orig`. `orig` should be discarded
    - Symbol owners and returns are substituted, as are parameter symbols
    - Recursive calls are not rewritten. This is correct if we assume that we either:
      - are in "in-place" mode, but can guarantee that no recursive calls exists
      - are associating the RHS with a cloned symbol, but intend for the original method to remain and for recursive calls to target it.
92.  def mkSuperInitCall: Global.Select
    Definition Classes
      TreeGen
93.  def mkSynchronized(monitor: Global.Tree)(body: Global.Tree): Global.Tree

    Make a synchronized block on 'monitor'.

94.  def mkSyntheticParam(pname: Global.TermName): Global.ValDef
    Definition Classes
      TreeGen
95.  def mkSyntheticUnit(): Global.Literal
    Definition Classes
      TreeGen
96.  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
97.  def mkThrowNewRuntimeException(message: String): Global.Throw
98.  def mkTreeOrBlock(stats: List[Global.Tree]): Global.Tree
    Definition Classes
      TreeGen
99.  def mkTuple(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree
    Definition Classes
      TreeGen
100.  def mkTupleType(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree
     Definition Classes
       TreeGen
101.  def mkTypeApply(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree
     Definition Classes
       TreeGen
102.  def mkUnattributedRef(fullName: Global.Name): Global.RefTree
     Definition Classes
       TreeGen
103.  def mkUnattributedRef(sym: Global.Symbol): Global.RefTree
     Definition Classes
       TreeGen
104.  def mkUnchecked(expr: Global.Tree): Global.Tree
     Definition Classes
       TreeGen
105.  def mkUnitBlock(expr: Global.Tree): Global.Block
     Definition Classes
       TreeGen
106.  def mkVisitor(cases: List[Global.CaseDef], checkExhaustive: Boolean, prefix: String)(implicit fresh: FreshNameCreator): Global.Tree
     Definition Classes
       TreeGen
107.  def mkWildcardImport(pkg: Global.Symbol): Global.Import

     Builds a fully attributed, synthetic wildcard import node.

108.  def mkWrapVarargsArray(tree: Global.Tree, elemtp: Global.Type): Global.Tree

     Applies a wrapArray call to an array, making it an immutable ArraySeq suitable for Scala varargs.

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

109.  def mkZero(tp: Global.Type): Global.Tree
     Definition Classes
       TreeGen
110.  final def ne(arg0: AnyRef): Boolean
     Definition Classes
       AnyRef
111.  def newModule(accessor: Global.Symbol, tpe: Global.Type): Global.Tree
112.  final def notify(): Unit
     Definition Classes
       AnyRef
     Annotations
       @native()
113.  final def notifyAll(): Unit
     Definition Classes
       AnyRef
     Annotations
       @native()
114.  def paramToArg(arg: Global.Ident, isRepeatedParam: Boolean): Global.Tree
115.  def paramToArg(vparam: Global.ValDef): Global.Tree
116.  def paramToArg(vparam: Global.Symbol): Global.Tree
117.  def rootId(name: Global.Name): Global.Select
     Definition Classes
       TreeGen
118.  def rootScalaDot(name: Global.Name): Global.Select
     Definition Classes
       TreeGen
119.  def scalaAnnotationDot(name: Global.Name): Global.Select
     Definition Classes
       TreeGen
120.  def scalaAnyRefConstr: Global.Select
     Definition Classes
       TreeGen
121.  def scalaDot(name: Global.Name): Global.Select
     Definition Classes
       TreeGen
122.  def scalaFunctionConstr(argtpes: List[Global.Tree], restpe: Global.Tree, abstractFun: Boolean): Global.Tree
     Definition Classes
       TreeGen
123.  def stabilize(tree: Global.Tree): Global.Tree
     Definition Classes
       TreeGen
124.  def stableTypeFor(tree: Global.Tree): Global.Type
     Definition Classes
       TreeGen
125.  final def synchronized[T0](arg0: => T0): T0
     Definition Classes
       AnyRef
126.  def toString(): String
     Definition Classes
       AnyRef → Any
127.  final def wait(): Unit
     Definition Classes
       AnyRef
     Annotations
       @throws(classOf[java.lang.InterruptedException])
128.  final def wait(arg0: Long, arg1: Int): Unit
     Definition Classes
       AnyRef
     Annotations
       @throws(classOf[java.lang.InterruptedException])
129.  final def wait(arg0: Long): Unit
     Definition Classes
       AnyRef
     Annotations
       @throws(classOf[java.lang.InterruptedException]) @native()
130.  def wildcardStar(tree: Global.Tree): Global.Typed
131.  object Filter
     Definition Classes
       TreeGen
132.  object Yield
     Definition Classes
       TreeGen
133.  object patvarTransformer extends PatvarTransformer
     Definition Classes
       TreeGen

### Deprecated Value Members

1.  def formatted(fmtstr: String): String
   Implicit
     This member is added by an implicit conversion from TreeGen toStringFormat[TreeGen] performed by method StringFormat in scala.Predef.
   Definition Classes
     StringFormat
   Annotations
     @deprecated @inline()
   Deprecated

     (Since version 2.12.16) Use `formatString.format(value)` instead of `value.formatted(formatString)`, or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.

2.  def →[B](y: B): (TreeGen, B)
   Implicit
     This member is added by an implicit conversion from TreeGen toArrowAssoc[TreeGen] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @deprecated
   Deprecated

     (Since version 2.13.0) Use `->` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

### Inherited from TreeDSL

### Inherited from reflect.internal.TreeGen

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion any2stringadd fromTreeGen to any2stringadd[TreeGen]

### Inherited by implicit conversion StringFormat fromTreeGen to StringFormat[TreeGen]

### Inherited by implicit conversion Ensuring fromTreeGen to Ensuring[TreeGen]

### Inherited by implicit conversion ArrowAssoc fromTreeGen to ArrowAssoc[TreeGen]

### Ungrouped