scala.reflect.api

Trees

trait Trees extends AnyRef

EXPERIMENTAL

This trait defines the node types used in Scala abstract syntax trees (AST) and operations on them.

Trees are the basis for Scala's abstract syntax that is used to represent programs. They are also called abstract syntax trees and commonly abbreviated as ASTs.

In Scala reflection, APIs that produce or use Trees are:

Trees are immutable, except for three fields pos, symbol, and tpe, which are assigned when a tree is typechecked to attribute it with the information gathered by the typechecker.

Examples

The following creates an AST representing a literal 5 in Scala source code:

Literal(Constant(5))

The following creates an AST representing print("Hello World"):

Apply(Select(Select(This(newTypeName("scala")), newTermName("Predef")), newTermName("print")), List(Literal(Constant("Hello World"))))

The following creates an AST from a literal 5, and then uses showRaw to print it in a readable format.

import scala.reflect.runtime.universe.{ reify, showRaw }
print( showRaw( reify{5}.tree ) )` // prints Literal(Constant(5))

For more information about Trees, see the Reflection Guide: Symbols, Trees, Types.

Self Type
Universe
Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Content Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Grouped
  2. Alphabetic
  3. By inheritance
Inherited
  1. Trees
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Alternative >: Null <: Universe.AlternativeApi with Universe.TermTree

    Alternatives of patterns.

  2. trait AlternativeApi extends Universe.TermTreeApi

    The API that all alternatives support

  3. abstract class AlternativeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Alternative(trees).

  4. abstract type Annotated >: Null <: Universe.AnnotatedApi with Universe.Tree

    A tree that has an annotation attached to it.

  5. trait AnnotatedApi extends Universe.TreeApi

    The API that all annotateds support

  6. abstract class AnnotatedExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Annotated(annot, arg).

  7. abstract type AppliedTypeTree >: Null <: Universe.AppliedTypeTreeApi with Universe.TypTree

    Applied type <tpt> [ <args> ], eliminated by RefCheck

  8. trait AppliedTypeTreeApi extends Universe.TypTreeApi

    The API that all applied type trees support

  9. abstract class AppliedTypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax AppliedTypeTree(tpt, args).

  10. abstract type Apply >: Null <: Universe.ApplyApi with Universe.GenericApply

    Value application

  11. trait ApplyApi extends Universe.GenericApplyApi

    The API that all applies support

  12. abstract class ApplyExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Apply(fun, args).

  13. abstract type Assign >: Null <: Universe.AssignApi with Universe.TermTree

    Assignment

  14. trait AssignApi extends Universe.TermTreeApi

    The API that all assigns support

  15. abstract class AssignExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Assign(lhs, rhs).

  16. abstract type AssignOrNamedArg >: Null <: Universe.AssignOrNamedArgApi with Universe.TermTree

    Either an assignment or a named argument.

  17. trait AssignOrNamedArgApi extends Universe.TermTreeApi

    The API that all assigns support

  18. abstract class AssignOrNamedArgExtractor extends AnyRef

    An extractor class to create and pattern match with syntax AssignOrNamedArg(lhs, rhs).

  19. abstract type Bind >: Null <: Universe.BindApi with Universe.DefTree

    Bind a variable to a rhs pattern.

  20. trait BindApi extends Universe.DefTreeApi

    The API that all binds support

  21. abstract class BindExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Bind(name, body).

  22. abstract type Block >: Null <: Universe.BlockApi with Universe.TermTree

    Block of expressions (semicolon separated expressions)

  23. trait BlockApi extends Universe.TermTreeApi

    The API that all blocks support

  24. abstract class BlockExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Block(stats, expr).

  25. abstract type CaseDef >: Null <: Universe.CaseDefApi with Universe.Tree

    Case clause in a pattern match.

  26. trait CaseDefApi extends Universe.TreeApi

    The API that all case defs support

  27. abstract class CaseDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax CaseDef(pat, guard, body).

  28. abstract type ClassDef >: Null <: Universe.ClassDefApi with Universe.ImplDef

    A class definition.

  29. trait ClassDefApi extends Universe.ImplDefApi

    The API that all class defs support

  30. abstract class ClassDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax ClassDef(mods, name, tparams, impl).

  31. abstract type CompoundTypeTree >: Null <: Universe.CompoundTypeTreeApi with Universe.TypTree

    Intersection type <parent1> with .

  32. trait CompoundTypeTreeApi extends Universe.TypTreeApi

    The API that all compound type trees support

  33. abstract class CompoundTypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax CompoundTypeTree(templ).

  34. abstract type DefDef >: Null <: Universe.DefDefApi with Universe.ValOrDefDef

    A method or macro definition.

  35. trait DefDefApi extends Universe.ValOrDefDefApi

    The API that all def defs support

  36. abstract class DefDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax DefDef(mods, name, tparams, vparamss, tpt, rhs).

  37. abstract type DefTree >: Null <: Universe.DefTreeApi with Universe.SymTree with Universe.NameTree

    A tree representing a symbol-defining entity: 1) A declaration or a definition (type, class, object, package, val, var, or def) 2) Bind that is used to represent binding occurrences in pattern matches 3) LabelDef that is used internally to represent while loops

  38. trait DefTreeApi extends Universe.SymTreeApi with Universe.NameTreeApi

    The API that all def trees support

  39. abstract type ExistentialTypeTree >: Null <: Universe.ExistentialTypeTreeApi with Universe.TypTree

    Existential type tree node

  40. trait ExistentialTypeTreeApi extends Universe.TypTreeApi

    The API that all existential type trees support

  41. abstract class ExistentialTypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax ExistentialTypeTree(tpt, whereClauses).

  42. abstract type Function >: Null <: Universe.FunctionApi with Universe.TermTree with Universe.SymTree

    Anonymous function, eliminated by compiler phase lambdalift

  43. trait FunctionApi extends Universe.TermTreeApi with Universe.SymTreeApi

    The API that all functions support

  44. abstract class FunctionExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Function(vparams, body).

  45. abstract type GenericApply >: Null <: Universe.GenericApplyApi with Universe.TermTree

    Common base class for Apply and TypeApply.

  46. trait GenericApplyApi extends Universe.TermTreeApi

    The API that all applies support

  47. abstract type Ident >: Null <: Universe.IdentApi with Universe.RefTree

    A reference to identifier name.

  48. trait IdentApi extends Universe.RefTreeApi

    The API that all idents support

  49. abstract class IdentExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Ident(qual, name).

  50. abstract type If >: Null <: Universe.IfApi with Universe.TermTree

    Conditional expression

  51. trait IfApi extends Universe.TermTreeApi

    The API that all ifs support

  52. abstract class IfExtractor extends AnyRef

    An extractor class to create and pattern match with syntax If(cond, thenp, elsep).

  53. abstract type ImplDef >: Null <: Universe.ImplDefApi with Universe.MemberDef

    A common base class for class and object definitions.

  54. trait ImplDefApi extends Universe.MemberDefApi

    The API that all impl defs support

  55. abstract type Import >: Null <: Universe.ImportApi with Universe.SymTree

    Import clause

  56. trait ImportApi extends Universe.SymTreeApi

    The API that all imports support

  57. abstract class ImportExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Import(expr, selectors).

  58. abstract type ImportSelector >: Null <: Universe.ImportSelectorApi

    Import selector (not a tree, but a component of the Import tree)

  59. trait ImportSelectorApi extends AnyRef

    The API that all import selectors support

  60. abstract class ImportSelectorExtractor extends AnyRef

    An extractor class to create and pattern match with syntax ImportSelector(name:, namePos, rename, renamePos).

  61. abstract type LabelDef >: Null <: Universe.LabelDefApi with Universe.DefTree with Universe.TermTree

    A labelled expression.

  62. trait LabelDefApi extends Universe.DefTreeApi with Universe.TermTreeApi

    The API that all label defs support

  63. abstract class LabelDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax LabelDef(name, params, rhs).

  64. abstract type Literal >: Null <: Universe.LiteralApi with Universe.TermTree

    Literal

  65. trait LiteralApi extends Universe.TermTreeApi

    The API that all literals support

  66. abstract class LiteralExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Literal(value).

  67. abstract type Match >: Null <: Universe.MatchApi with Universe.TermTree

    - Pattern matching expression (before compiler phase explicitouter before 2.

  68. trait MatchApi extends Universe.TermTreeApi

    The API that all matches support

  69. abstract class MatchExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Match(selector, cases).

  70. abstract type MemberDef >: Null <: Universe.MemberDefApi with Universe.DefTree

    Common base class for all member definitions: types, classes, objects, packages, vals and vars, defs.

  71. trait MemberDefApi extends Universe.DefTreeApi

    The API that all member defs support

  72. abstract type Modifiers >: Null <: Universe.ModifiersApi

    The type of tree modifiers (not a tree, but rather part of DefTrees).

  73. abstract class ModifiersApi extends AnyRef

    The API that all Modifiers support

  74. abstract class ModifiersExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Modifiers(flags, privateWithin, annotations).

  75. abstract type ModuleDef >: Null <: Universe.ModuleDefApi with Universe.ImplDef

    An object definition, e.

  76. trait ModuleDefApi extends Universe.ImplDefApi

    The API that all module defs support

  77. abstract class ModuleDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax ModuleDef(mods, name, impl).

  78. abstract type NameTree >: Null <: Universe.NameTreeApi with Universe.Tree

    A tree that carries a name, e.

  79. trait NameTreeApi extends Universe.TreeApi

    The API that all name trees support

  80. abstract type New >: Null <: Universe.NewApi with Universe.TermTree

    Object instantiation

  81. trait NewApi extends Universe.TermTreeApi

    The API that all news support

  82. abstract class NewExtractor extends AnyRef

    An extractor class to create and pattern match with syntax New(tpt).

  83. abstract type PackageDef >: Null <: Universe.PackageDefApi with Universe.MemberDef

    A packaging, such as package pid { stats }

  84. trait PackageDefApi extends Universe.MemberDefApi

    The API that all package defs support

  85. abstract class PackageDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax PackageDef(pid, stats).

  86. abstract type RefTree >: Null <: Universe.RefTreeApi with Universe.SymTree with Universe.NameTree

    A tree which references a symbol-carrying entity.

  87. trait RefTreeApi extends Universe.SymTreeApi with Universe.NameTreeApi

    The API that all ref trees support

  88. abstract class RefTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax RefTree(qual, name).

  89. abstract type Return >: Null <: Universe.ReturnApi with Universe.SymTree with Universe.TermTree

    Return expression

  90. trait ReturnApi extends Universe.TermTreeApi

    The API that all returns support

  91. abstract class ReturnExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Return(expr).

  92. abstract type Select >: Null <: Universe.SelectApi with Universe.RefTree

    A member selection <qualifier> .

  93. trait SelectApi extends Universe.RefTreeApi

    The API that all selects support

  94. abstract class SelectExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Select(qual, name).

  95. abstract type SelectFromTypeTree >: Null <: Universe.SelectFromTypeTreeApi with Universe.TypTree with Universe.RefTree

    Type selection <qualifier> # <name>, eliminated by RefCheck

  96. trait SelectFromTypeTreeApi extends Universe.TypTreeApi with Universe.RefTreeApi

    The API that all selects from type trees support

  97. abstract class SelectFromTypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax SelectFromTypeTree(qualifier, name).

  98. abstract type SingletonTypeTree >: Null <: Universe.SingletonTypeTreeApi with Universe.TypTree

    Singleton type, eliminated by RefCheck

  99. trait SingletonTypeTreeApi extends Universe.TypTreeApi

    The API that all singleton type trees support

  100. abstract class SingletonTypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax SingletonTypeTree(ref).

  101. abstract type Star >: Null <: Universe.StarApi with Universe.TermTree

    Repetition of pattern.

  102. trait StarApi extends Universe.TermTreeApi

    The API that all stars support

  103. abstract class StarExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Star(elem).

  104. abstract type Super >: Null <: Universe.SuperApi with Universe.TermTree

    Super reference, where qual is the corresponding this reference.

  105. trait SuperApi extends Universe.TermTreeApi

    The API that all supers support

  106. abstract class SuperExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Super(qual, mix).

  107. abstract type SymTree >: Null <: Universe.SymTreeApi with Universe.Tree

    A tree that carries a symbol, e.

  108. trait SymTreeApi extends Universe.TreeApi

    The API that all sym trees support

  109. abstract type Template >: Null <: Universe.TemplateApi with Universe.SymTree

    Instantiation template of a class or trait

  110. trait TemplateApi extends Universe.SymTreeApi

    The API that all templates support

  111. abstract class TemplateExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Template(parents, self, body).

  112. abstract type TermTree >: Null <: Universe.TermTreeApi with Universe.Tree

    A tree for a term.

  113. trait TermTreeApi extends Universe.TreeApi

    The API that all term trees support

  114. abstract type This >: Null <: Universe.ThisApi with Universe.TermTree with Universe.SymTree

    Self reference

  115. trait ThisApi extends Universe.TermTreeApi with Universe.SymTreeApi

    The API that all thises support

  116. abstract class ThisExtractor extends AnyRef

    An extractor class to create and pattern match with syntax This(qual).

  117. abstract type Throw >: Null <: Universe.ThrowApi with Universe.TermTree

    Throw expression

  118. trait ThrowApi extends Universe.TermTreeApi

    The API that all tries support

  119. abstract class ThrowExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Throw(expr).

  120. abstract class Transformer extends AnyRef

    A class that implement a default tree transformation strategy: breadth-first component-wise cloning.

  121. class Traverser extends AnyRef

    A class that implement a default tree traversal strategy: breadth-first component-wise.

  122. abstract type Tree >: Null <: Universe.TreeApi

    The type of Scala abstract syntax trees.

  123. trait TreeApi extends Product

    The API that all trees support.

  124. abstract type TreeCopier >: Null <: Universe.TreeCopierOps

    The type of standard (lazy) tree copiers.

  125. abstract class TreeCopierOps extends AnyRef

    The API of a tree copier.

  126. abstract type Try >: Null <: Universe.TryApi with Universe.TermTree

    Try catch node

  127. trait TryApi extends Universe.TermTreeApi

    The API that all tries support

  128. abstract class TryExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Try(block, catches, finalizer).

  129. abstract type TypTree >: Null <: Universe.TypTreeApi with Universe.Tree

    A tree for a type.

  130. trait TypTreeApi extends Universe.TreeApi

    The API that all typ trees support

  131. abstract type TypeApply >: Null <: Universe.TypeApplyApi with Universe.GenericApply

    Explicit type application.

  132. trait TypeApplyApi extends Universe.GenericApplyApi

    The API that all type applies support

  133. abstract class TypeApplyExtractor extends AnyRef

    An extractor class to create and pattern match with syntax TypeApply(fun, args).

  134. abstract type TypeBoundsTree >: Null <: Universe.TypeBoundsTreeApi with Universe.TypTree

    Type bounds tree node

  135. trait TypeBoundsTreeApi extends Universe.TypTreeApi

    The API that all type bound trees support

  136. abstract class TypeBoundsTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax TypeBoundsTree(lo, hi).

  137. abstract type TypeDef >: Null <: Universe.TypeDefApi with Universe.MemberDef

    An abstract type, a type parameter, or a type alias.

  138. trait TypeDefApi extends Universe.MemberDefApi

    The API that all type defs support

  139. abstract class TypeDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax TypeDef(mods, name, tparams, rhs).

  140. abstract type TypeTree >: Null <: Universe.TypeTreeApi with Universe.TypTree

    A synthetic tree holding an arbitrary type.

  141. trait TypeTreeApi extends Universe.TypTreeApi

    The API that all type trees support

  142. abstract class TypeTreeExtractor extends AnyRef

    An extractor class to create and pattern match with syntax TypeTree().

  143. abstract type Typed >: Null <: Universe.TypedApi with Universe.TermTree

    Type annotation, eliminated by compiler phase cleanup

  144. trait TypedApi extends Universe.TermTreeApi

    The API that all typeds support

  145. abstract class TypedExtractor extends AnyRef

    An extractor class to create and pattern match with syntax Typed(expr, tpt).

  146. abstract type UnApply >: Null <: Universe.UnApplyApi with Universe.TermTree

    Used to represent unapply methods in pattern matching.

  147. trait UnApplyApi extends Universe.TermTreeApi

    The API that all unapplies support

  148. abstract class UnApplyExtractor extends AnyRef

    An extractor class to create and pattern match with syntax UnApply(fun, args).

  149. abstract type ValDef >: Null <: Universe.ValDefApi with Universe.ValOrDefDef

    Broadly speaking, a value definition.

  150. trait ValDefApi extends Universe.ValOrDefDefApi

    The API that all val defs support

  151. abstract class ValDefExtractor extends AnyRef

    An extractor class to create and pattern match with syntax ValDef(mods, name, tpt, rhs).

  152. abstract type ValOrDefDef >: Null <: Universe.ValOrDefDefApi with Universe.MemberDef

    A common base class for ValDefs and DefDefs.

  153. trait ValOrDefDefApi extends Universe.MemberDefApi

    The API that all val defs and def defs support

  154. type ModifiersCreator = Universe.ModifiersExtractor

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use ModifiersExtractor instead

Abstract Value Members

  1. abstract val Alternative: Universe.AlternativeExtractor

    The constructor/extractor for Alternative instances.

  2. abstract val Annotated: Universe.AnnotatedExtractor

    The constructor/extractor for Annotated instances.

  3. abstract val AppliedTypeTree: Universe.AppliedTypeTreeExtractor

    The constructor/extractor for AppliedTypeTree instances.

  4. abstract val Apply: Universe.ApplyExtractor

    The constructor/extractor for Apply instances.

  5. abstract val Assign: Universe.AssignExtractor

    The constructor/extractor for Assign instances.

  6. abstract val AssignOrNamedArg: Universe.AssignOrNamedArgExtractor

    The constructor/extractor for AssignOrNamedArg instances.

  7. abstract val Bind: Universe.BindExtractor

    The constructor/extractor for Bind instances.

  8. abstract val Block: Universe.BlockExtractor

    The constructor/extractor for Block instances.

  9. abstract val CaseDef: Universe.CaseDefExtractor

    The constructor/extractor for CaseDef instances.

  10. abstract val ClassDef: Universe.ClassDefExtractor

    The constructor/extractor for ClassDef instances.

  11. abstract val CompoundTypeTree: Universe.CompoundTypeTreeExtractor

    The constructor/extractor for CompoundTypeTree instances.

  12. abstract val DefDef: Universe.DefDefExtractor

    The constructor/extractor for DefDef instances.

  13. abstract val EmptyTree: Universe.Tree

    The empty tree

  14. abstract val ExistentialTypeTree: Universe.ExistentialTypeTreeExtractor

    The constructor/extractor for ExistentialTypeTree instances.

  15. abstract val Function: Universe.FunctionExtractor

    The constructor/extractor for Function instances.

  16. abstract def Ident(sym: Universe.Symbol): Universe.Ident

    A factory method for Ident nodes.

  17. abstract val Ident: Universe.IdentExtractor

    The constructor/extractor for Ident instances.

  18. abstract val If: Universe.IfExtractor

    The constructor/extractor for If instances.

  19. abstract val Import: Universe.ImportExtractor

    The constructor/extractor for Import instances.

  20. abstract val ImportSelector: Universe.ImportSelectorExtractor

    The constructor/extractor for ImportSelector instances.

  21. abstract val LabelDef: Universe.LabelDefExtractor

    The constructor/extractor for LabelDef instances.

  22. abstract val Literal: Universe.LiteralExtractor

    The constructor/extractor for Literal instances.

  23. abstract val Match: Universe.MatchExtractor

    The constructor/extractor for Match instances.

  24. abstract val Modifiers: Universe.ModifiersExtractor

    The constructor/extractor for Modifiers instances.

  25. abstract val ModuleDef: Universe.ModuleDefExtractor

    The constructor/extractor for ModuleDef instances.

  26. abstract val New: Universe.NewExtractor

    The constructor/extractor for New instances.

  27. abstract val PackageDef: Universe.PackageDefExtractor

    The constructor/extractor for PackageDef instances.

  28. abstract val RefTree: Universe.RefTreeExtractor

    The constructor/extractor for RefTree instances.

  29. abstract val Return: Universe.ReturnExtractor

    The constructor/extractor for Return instances.

  30. abstract def Select(qualifier: Universe.Tree, sym: Universe.Symbol): Universe.Select

    A factory method for Select nodes.

  31. abstract val Select: Universe.SelectExtractor

    The constructor/extractor for Select instances.

  32. abstract val SelectFromTypeTree: Universe.SelectFromTypeTreeExtractor

    The constructor/extractor for SelectFromTypeTree instances.

  33. abstract val SingletonTypeTree: Universe.SingletonTypeTreeExtractor

    The constructor/extractor for SingletonTypeTree instances.

  34. abstract val Star: Universe.StarExtractor

    The constructor/extractor for Star instances.

  35. abstract val Super: Universe.SuperExtractor

    The constructor/extractor for Super instances.

  36. abstract val Template: Universe.TemplateExtractor

    The constructor/extractor for Template instances.

  37. abstract def This(sym: Universe.Symbol): Universe.Tree

    A factory method for This nodes.

  38. abstract val This: Universe.ThisExtractor

    The constructor/extractor for This instances.

  39. abstract val Throw: Universe.ThrowExtractor

    The constructor/extractor for Throw instances.

  40. abstract val Try: Universe.TryExtractor

    The constructor/extractor for Try instances.

  41. abstract val TypeApply: Universe.TypeApplyExtractor

    The constructor/extractor for TypeApply instances.

  42. abstract val TypeBoundsTree: Universe.TypeBoundsTreeExtractor

    The constructor/extractor for TypeBoundsTree instances.

  43. abstract val TypeDef: Universe.TypeDefExtractor

    The constructor/extractor for TypeDef instances.

  44. abstract def TypeTree(tp: Universe.Type): Universe.TypeTree

    A factory method for TypeTree nodes.

  45. abstract val TypeTree: Universe.TypeTreeExtractor

    The constructor/extractor for TypeTree instances.

  46. abstract val Typed: Universe.TypedExtractor

    The constructor/extractor for Typed instances.

  47. abstract val UnApply: Universe.UnApplyExtractor

    The constructor/extractor for UnApply instances.

  48. abstract val ValDef: Universe.ValDefExtractor

    The constructor/extractor for ValDef instances.

  49. abstract def newLazyTreeCopier: Universe.TreeCopier

    Creates a lazy tree copier.

  50. abstract def newStrictTreeCopier: Universe.TreeCopier

    Creates a strict tree copier.

  51. abstract val noSelfType: Universe.ValDef

    An empty deferred value definition corresponding to: val _: _ This is used as a placeholder in the self parameter Template if there is no definition of a self value of self type.

  52. abstract val pendingSuperCall: Universe.Apply

    An empty superclass constructor call corresponding to: super.

    An empty superclass constructor call corresponding to: super.<init>() This is used as a placeholder in the primary constructor body in class templates to denote the insertion point of a call to superclass constructor after the typechecker figures out the superclass of a given template.

  53. abstract def treeToString(tree: Universe.Tree): String

    Obtains string representation of a tree

    Obtains string representation of a tree

    Attributes
    protected
  54. abstract def Apply(sym: Universe.Symbol, args: Universe.Tree*): Universe.Tree

    A factory method for Apply nodes.

    A factory method for Apply nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"$sym(..$args)" instead

  55. abstract def ApplyConstructor(tpt: Universe.Tree, args: List[Universe.Tree]): Universe.Tree

    0-1 argument list new, based on a type tree.

    0-1 argument list new, based on a type tree.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"new $tpt(..$args)" instead

  56. abstract def Bind(sym: Universe.Symbol, body: Universe.Tree): Universe.Bind

    A factory method for Bind nodes.

    A factory method for Bind nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use the canonical Bind constructor to create a bind and then initialize its symbol manually

  57. abstract def Block(stats: Universe.Tree*): Universe.Block

    A factory method for Block nodes.

    A factory method for Block nodes. Flattens directly nested blocks.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"{..$stats}" instead. Flatten directly nested blocks manually if needed

  58. abstract def CaseDef(pat: Universe.Tree, body: Universe.Tree): Universe.CaseDef

    A factory method for CaseDef nodes.

    A factory method for CaseDef nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use cq"$pat => $body" instead

  59. abstract def Ident(name: String): Universe.Ident

    A factory method for Ident nodes.

    A factory method for Ident nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use Ident(TermName(name)) instead

  60. abstract def New(sym: Universe.Symbol, args: Universe.Tree*): Universe.Tree

    0-1 argument list new, based on a symbol.

    0-1 argument list new, based on a symbol.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"new ${sym.toType}(..$args)" instead

  61. abstract def New(tpe: Universe.Type, args: Universe.Tree*): Universe.Tree

    0-1 argument list new, based on a type.

    0-1 argument list new, based on a type.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"new $tpe(..$args)" instead

  62. abstract def New(tpt: Universe.Tree, argss: List[List[Universe.Tree]]): Universe.Tree

    Factory method for object creation new tpt(args_1)...(args_n) A New(t, as) is expanded to: (new t).<init>(as)

    Factory method for object creation new tpt(args_1)...(args_n) A New(t, as) is expanded to: (new t).<init>(as)

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"new $tpt(...$argss)" instead

  63. abstract def Select(qualifier: Universe.Tree, name: String): Universe.Select

    A factory method for Select nodes.

    A factory method for Select nodes. The string name argument is assumed to represent a TermName.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use Select(tree, TermName(name)) instead

  64. abstract def Super(sym: Universe.Symbol, mix: Universe.TypeName): Universe.Tree

    A factory method for Super nodes.

    A factory method for Super nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"$sym.super[$mix].x".qualifier instead

  65. abstract def Throw(tpe: Universe.Type, args: Universe.Tree*): Universe.Throw

    A factory method for Throw nodes.

    A factory method for Throw nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Use q"throw new $tpe(..$args)" instead

  66. abstract def Try(body: Universe.Tree, cases: (Universe.Tree, Universe.Tree)*): Universe.Try

    A factory method for Try nodes.

    A factory method for Try nodes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.1) Convert cases into casedefs and use q"try $body catch { case ..$newcases }" instead

  67. abstract val emptyValDef: Universe.ValDef

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use noSelfType instead

Concrete Value Members

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

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

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

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

    Definition Classes
    AnyRef → Any
  6. def Modifiers(flags: Universe.FlagSet): Universe.Modifiers

    The factory for Modifiers instances.

  7. def Modifiers(flags: Universe.FlagSet, privateWithin: Universe.Name): Universe.Modifiers

    The factory for Modifiers instances.

  8. lazy val NoMods: Universe.Modifiers

    An empty Modifiers object: no flags, empty visibility annotation and no Scala annotations.

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def ensuring(cond: (Trees) ⇒ Boolean, msg: ⇒ Any): Trees

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

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

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

    Implicit information
    This member is added by an implicit conversion from Trees to Ensuring[Trees] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  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. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Trees to StringFormat[Trees] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  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. def itransform(transformer: Universe.Transformer, tree: Universe.Tree): Universe.Tree

    Delegates the transformation strategy to scala.reflect.internal.Trees, because pattern matching on abstract types we have here degrades performance.

    Delegates the transformation strategy to scala.reflect.internal.Trees, because pattern matching on abstract types we have here degrades performance.

    Attributes
    protected
  23. def itraverse(traverser: Universe.Traverser, tree: Universe.Tree): Unit

    Delegates the traversal strategy to scala.reflect.internal.Trees, because pattern matching on abstract types we have here degrades performance.

    Delegates the traversal strategy to scala.reflect.internal.Trees, because pattern matching on abstract types we have here degrades performance.

    Attributes
    protected
  24. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. val treeCopy: Universe.TreeCopier

    The standard (lazy) tree copier.

  30. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. def xtransform(transformer: Universe.Transformer, tree: Universe.Tree): Universe.Tree

    Provides an extension hook for the transformation strategy.

    Provides an extension hook for the transformation strategy. Future-proofs against new node types.

    Attributes
    protected
  34. def xtraverse(traverser: Universe.Traverser, tree: Universe.Tree): Unit

    Provides an extension hook for the traversal strategy.

    Provides an extension hook for the traversal strategy. Future-proofs against new node types.

    Attributes
    protected
  35. def [B](y: B): (Trees, B)

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

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Trees to any2stringadd[Trees]

Inherited by implicit conversion StringFormat from Trees to StringFormat[Trees]

Inherited by implicit conversion Ensuring from Trees to Ensuring[Trees]

Inherited by implicit conversion ArrowAssoc from Trees to ArrowAssoc[Trees]

Trees

Tree Copying

Factories

Tree Traversal and Transformation

API

The methods available for each reflection entity, without the implementation. Since the reflection entities are later overridden by runtime reflection and macros, their API counterparts guarantee a minimum set of methods that are implemented.

Extractors

Extractors provide the machinery necessary to allow pattern matching and construction of reflection entities that is similar to case classes, although the entities are only abstract types that are later overridden.

Ungrouped