Trait

scala.reflect.api

Trees

Related Doc: package api

Permalink

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(TypeName("scala")), TermName("Predef")), TermName("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
Source
Trees.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Content Hierarchy
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
Visibility
  1. Public
  2. All

Trees

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

    Permalink

    Alternatives of patterns.

    Alternatives of patterns.

    Eliminated by compiler phases Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher), except for occurrences in encoded Switch stmt (i.e. remaining Match(CaseDef(...)))

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

    Permalink

    A tree that has an annotation attached to it.

    A tree that has an annotation attached to it. Only used for annotated types and annotation ascriptions, annotations on definitions are stored in the Modifiers. Eliminated by typechecker (typedAnnotated), the annotations are then stored in an AnnotatedType.

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

    Permalink

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

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

    Permalink

    Value application

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

    Permalink

    Assignment

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

    Permalink

    Either an assignment or a named argument.

    Either an assignment or a named argument. Only appears in argument lists, eliminated by compiler phase typecheck (doTypedApply), resurrected by reifier.

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

    Permalink

    Bind a variable to a rhs pattern.

    Bind a variable to a rhs pattern.

    Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).

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

    Permalink

    Block of expressions (semicolon separated expressions)

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

    Permalink

    Case clause in a pattern match.

    Case clause in a pattern match. (except for occurrences in switch statements). Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher)

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

    Permalink

    A class definition.

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

    Permalink

    Intersection type <parent1> with ...

    Intersection type <parent1> with ... with <parentN> { <decls> }, eliminated by RefCheck

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

    Permalink

    A method or macro definition.

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

    Permalink

    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

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

    Permalink

    Existential type tree node

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

    Permalink

    Anonymous function, eliminated by compiler phase lambdalift

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

    Permalink

    Common base class for Apply and TypeApply.

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

    Permalink

    A reference to identifier name.

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

    Permalink

    Conditional expression

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

    Permalink

    A common base class for class and object definitions.

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

    Permalink

    Import clause

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

    Permalink

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

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

    Representation of an imported name its optional rename and their optional positions

    Eliminated by typecheck.

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

    Permalink

    A labelled expression.

    A labelled expression. Not expressible in language syntax, but generated by the compiler to simulate while/do-while loops, and also by the pattern matcher.

    The label acts much like a nested function, where params represents the incoming parameters. The symbol given to the LabelDef should have a MethodType, as if it were a nested function.

    Jumps are apply nodes attributed with a label's symbol. The arguments from the apply node will be passed to the label and assigned to the Idents.

    Forward jumps within a block are allowed.

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

    Permalink

    Literal

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

    Permalink

    - Pattern matching expression (before compiler phase explicitouter before 2.10 / patmat from 2.10)

    - Pattern matching expression (before compiler phase explicitouter before 2.10 / patmat from 2.10)

    • Switch statements (after compiler phase explicitouter before 2.10 / patmat from 2.10)

    After compiler phase explicitouter before 2.10 / patmat from 2.10, cases will satisfy the following constraints:

    • all guards are EmptyTree,
    • all patterns will be either Literal(Constant(x:Int)) or Alternative(lit|...|lit)
    • except for an "otherwise" branch, which has pattern Ident(nme.WILDCARD)
  25. abstract type MemberDef >: Null <: Universe.MemberDefApi with Universe.DefTree

    Permalink

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

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

    Permalink

    An object definition, e.g.

    An object definition, e.g. object Foo. Internally, objects are quite frequently called modules to reduce ambiguity. Eliminated by compiler phase refcheck.

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

    Permalink

    A tree that carries a name, e.g.

    A tree that carries a name, e.g. by defining it (DefTree) or by referring to it (RefTree).

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

    Permalink

    Object instantiation

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

    Permalink

    A packaging, such as package pid { stats }

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

    Permalink

    A tree which references a symbol-carrying entity.

    A tree which references a symbol-carrying entity. References one, as opposed to defining one; definitions are in DefTrees.

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

    Permalink

    Return expression

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

    Permalink

    A member selection <qualifier> .

    A member selection <qualifier> . <name>

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

    Permalink

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

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

    Permalink

    Singleton type, eliminated by RefCheck

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

    Permalink

    Repetition of pattern.

    Repetition of pattern.

    Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).

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

    Permalink

    Super reference, where qual is the corresponding this reference.

    Super reference, where qual is the corresponding this reference. A super reference C.super[M] is represented as Super(This(C), M).

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

    Permalink

    A tree that carries a symbol, e.g.

    A tree that carries a symbol, e.g. by defining it (DefTree) or by referring to it (RefTree). Such trees start their life naked, returning NoSymbol, but after being typechecked without errors they hold non-empty symbols.

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

    Permalink

    Instantiation template of a class or trait

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

    Permalink

    A tree for a term.

    A tree for a term. Not all trees representing terms are TermTrees; use isTerm to reliably identify terms.

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

    Permalink

    Self reference

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

    Permalink

    Throw expression

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

    Permalink

    The type of Scala abstract syntax trees.

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

    Permalink

    Try catch node

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

    Permalink

    A tree for a type.

    A tree for a type. Not all trees representing types are TypTrees; use isType to reliably identify types.

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

    Permalink

    Explicit type application.

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

    Permalink

    Type bounds tree node

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

    Permalink

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

    An abstract type, a type parameter, or a type alias. Eliminated by erasure.

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

    Permalink

    A synthetic tree holding an arbitrary type.

    A synthetic tree holding an arbitrary type. Not to be confused with with TypTree, the trait for trees that are only used for type trees. TypeTree's are inserted in several places, but most notably in RefCheck, where the arbitrary type trees are all replaced by TypeTree's.

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

    Permalink

    Type annotation, eliminated by compiler phase cleanup

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

    Permalink

    Used to represent unapply methods in pattern matching.

    Used to represent unapply methods in pattern matching.

    For example:

    2 match { case Foo(x) => x }

    Is represented as:

    Match(
      Literal(Constant(2)),
      List(
        CaseDef(
          UnApply(
            // a dummy node that carries the type of unapplication to patmat
            // the  here doesn't have an underlying symbol
            // it only has a type assigned, therefore after `untypecheck` this tree is no longer typeable
            Apply(Select(Ident(Foo), TermName("unapply")), List(Ident(TermName("")))),
            // arguments of the unapply => nothing synthetic here
            List(Bind(TermName("x"), Ident(nme.WILDCARD)))),
          EmptyTree,
          Ident(TermName("x")))))

    Introduced by typer. Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).

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

    Permalink

    Broadly speaking, a value definition.

    Broadly speaking, a value definition. All these are encoded as ValDefs:

    • immutable values, e.g. "val x"
    • mutable values, e.g. "var x" - the MUTABLE flag set in mods
    • lazy values, e.g. "lazy val x" - the LAZY flag set in mods
    • method parameters, see vparamss in scala.reflect.api.Trees#DefDef - the PARAM flag is set in mods
    • explicit self-types, e.g. class A { self: Bar => }
  52. abstract type ValOrDefDef >: Null <: Universe.ValOrDefDefApi with Universe.MemberDef

    Permalink

    A common base class for ValDefs and DefDefs.

  1. abstract val EmptyTree: Universe.Tree

    Permalink

    The empty tree

  2. abstract val noSelfType: Universe.ValDef

    Permalink

    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.

  3. abstract val pendingSuperCall: Universe.Apply

    Permalink

    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.

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

    Permalink

    Obtains string representation of a tree

    Obtains string representation of a tree

    Attributes
    protected

Tree Copying

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

    Permalink

    The type of standard (lazy) tree copiers.

  1. abstract def newLazyTreeCopier: Universe.TreeCopier

    Permalink

    Creates a lazy tree copier.

  2. abstract def newStrictTreeCopier: Universe.TreeCopier

    Permalink

    Creates a strict tree copier.

  3. val treeCopy: Universe.TreeCopier

    Permalink

    The standard (lazy) tree copier.

Factories

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

    Permalink

    A factory method for Ident nodes.

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

    Permalink

    A factory method for Select nodes.

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

    Permalink

    A factory method for This nodes.

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

    Permalink

    A factory method for TypeTree nodes.

  5. abstract def Apply(sym: Universe.Symbol, args: Universe.Tree*): Universe.Tree

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

Tree Traversal and Transformation

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

    Permalink

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

  2. abstract class ModifiersExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Modifiers(flags, privateWithin, annotations). Modifiers encapsulate flags, visibility annotations and Scala annotations for member definitions.

  3. abstract class Transformer extends AnyRef

    Permalink

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

  4. class Traverser extends AnyRef

    Permalink

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

  1. abstract val Modifiers: Universe.ModifiersExtractor

    Permalink

    The constructor/extractor for Modifiers instances.

  2. def Modifiers(flags: Universe.FlagSet): Universe.Modifiers

    Permalink

    The factory for Modifiers instances.

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

    Permalink

    The factory for Modifiers instances.

  4. lazy val NoMods: Universe.Modifiers

    Permalink

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

  5. def itransform(transformer: Universe.Transformer, tree: Universe.Tree): Universe.Tree

    Permalink

    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
  6. def itraverse(traverser: Universe.Traverser, tree: Universe.Tree): Unit

    Permalink

    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
  7. def xtransform(transformer: Universe.Transformer, tree: Universe.Tree): Universe.Tree

    Permalink

    Provides an extension hook for the transformation strategy.

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

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

    Permalink

    Provides an extension hook for the traversal strategy.

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

    Attributes
    protected

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.

  1. trait AlternativeApi extends Universe.TermTreeApi

    Permalink

    The API that all alternatives support

  2. trait AnnotatedApi extends Universe.TreeApi

    Permalink

    The API that all annotateds support

  3. trait AppliedTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all applied type trees support

  4. trait ApplyApi extends Universe.GenericApplyApi

    Permalink

    The API that all applies support

  5. trait AssignApi extends Universe.TermTreeApi

    Permalink

    The API that all assigns support

  6. trait AssignOrNamedArgApi extends Universe.TermTreeApi

    Permalink

    The API that all assigns support

  7. trait BindApi extends Universe.DefTreeApi

    Permalink

    The API that all binds support

  8. trait BlockApi extends Universe.TermTreeApi

    Permalink

    The API that all blocks support

  9. trait CaseDefApi extends Universe.TreeApi

    Permalink

    The API that all case defs support

  10. trait ClassDefApi extends Universe.ImplDefApi

    Permalink

    The API that all class defs support

  11. trait CompoundTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all compound type trees support

  12. trait DefDefApi extends Universe.ValOrDefDefApi

    Permalink

    The API that all def defs support

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

    Permalink

    The API that all def trees support

  14. trait ExistentialTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all existential type trees support

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

    Permalink

    The API that all functions support

  16. trait GenericApplyApi extends Universe.TermTreeApi

    Permalink

    The API that all applies support

  17. trait IdentApi extends Universe.RefTreeApi

    Permalink

    The API that all idents support

  18. trait IfApi extends Universe.TermTreeApi

    Permalink

    The API that all ifs support

  19. trait ImplDefApi extends Universe.MemberDefApi

    Permalink

    The API that all impl defs support

  20. trait ImportApi extends Universe.SymTreeApi

    Permalink

    The API that all imports support

  21. trait ImportSelectorApi extends AnyRef

    Permalink

    The API that all import selectors support

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

    Permalink

    The API that all label defs support

  23. trait LiteralApi extends Universe.TermTreeApi

    Permalink

    The API that all literals support

  24. trait MatchApi extends Universe.TermTreeApi

    Permalink

    The API that all matches support

  25. trait MemberDefApi extends Universe.DefTreeApi

    Permalink

    The API that all member defs support

  26. abstract class ModifiersApi extends AnyRef

    Permalink

    The API that all Modifiers support

  27. trait ModuleDefApi extends Universe.ImplDefApi

    Permalink

    The API that all module defs support

  28. trait NameTreeApi extends Universe.TreeApi

    Permalink

    The API that all name trees support

  29. trait NewApi extends Universe.TermTreeApi

    Permalink

    The API that all news support

  30. trait PackageDefApi extends Universe.MemberDefApi

    Permalink

    The API that all package defs support

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

    Permalink

    The API that all ref trees support

  32. trait ReturnApi extends Universe.TermTreeApi

    Permalink

    The API that all returns support

  33. trait SelectApi extends Universe.RefTreeApi

    Permalink

    The API that all selects support

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

    Permalink

    The API that all selects from type trees support

  35. trait SingletonTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all singleton type trees support

  36. trait StarApi extends Universe.TermTreeApi

    Permalink

    The API that all stars support

  37. trait SuperApi extends Universe.TermTreeApi

    Permalink

    The API that all supers support

  38. trait SymTreeApi extends Universe.TreeApi

    Permalink

    The API that all sym trees support

  39. trait TemplateApi extends Universe.SymTreeApi

    Permalink

    The API that all templates support

  40. trait TermTreeApi extends Universe.TreeApi

    Permalink

    The API that all term trees support

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

    Permalink

    The API that all thises support

  42. trait ThrowApi extends Universe.TermTreeApi

    Permalink

    The API that all tries support

  43. trait TreeApi extends Product

    Permalink

    The API that all trees support.

    The API that all trees support. The main source of information about trees is the scala.reflect.api.Trees page.

  44. abstract class TreeCopierOps extends AnyRef

    Permalink

    The API of a tree copier.

  45. trait TryApi extends Universe.TermTreeApi

    Permalink

    The API that all tries support

  46. trait TypTreeApi extends Universe.TreeApi

    Permalink

    The API that all typ trees support

  47. trait TypeApplyApi extends Universe.GenericApplyApi

    Permalink

    The API that all type applies support

  48. trait TypeBoundsTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all type bound trees support

  49. trait TypeDefApi extends Universe.MemberDefApi

    Permalink

    The API that all type defs support

  50. trait TypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all type trees support

  51. trait TypedApi extends Universe.TermTreeApi

    Permalink

    The API that all typeds support

  52. trait UnApplyApi extends Universe.TermTreeApi

    Permalink

    The API that all unapplies support

  53. trait ValDefApi extends Universe.ValOrDefDefApi

    Permalink

    The API that all val defs support

  54. trait ValOrDefDefApi extends Universe.MemberDefApi

    Permalink

    The API that all val defs and def defs support

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.

  1. abstract class AlternativeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Alternative(trees). This AST node corresponds to the following Scala code:

    pat1 | ... | patn

  2. abstract class AnnotatedExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Annotated(annot, arg). This AST node corresponds to the following Scala code:

    arg @annot // for types arg: @annot // for exprs

  3. abstract class AppliedTypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax AppliedTypeTree(tpt, args). This AST node corresponds to the following Scala code:

    tpt[args]

    Should only be used with tpt nodes which are types, i.e. which have isType returning true. Otherwise TypeApply should be used instead.

    List[Int] as in val x: List[Int] = ??? // represented as AppliedTypeTree(Ident(<List>), List(TypeTree(<Int>)))

    def foo[T] = ??? foo[Int] // represented as TypeApply(Ident(<foo>), List(TypeTree(<Int>)))

  4. abstract class ApplyExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Apply(fun, args). This AST node corresponds to the following Scala code:

    fun(args)

    For instance:

    fun[targs](args)

    Is expressed as:

    Apply(TypeApply(fun, targs), args)

  5. abstract class AssignExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Assign(lhs, rhs). This AST node corresponds to the following Scala code:

    lhs = rhs

  6. abstract class AssignOrNamedArgExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax AssignOrNamedArg(lhs, rhs). This AST node corresponds to the following Scala code:

    m.f(lhs = rhs)
    @annotation(lhs = rhs)
  7. abstract class BindExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Bind(name, body). This AST node corresponds to the following Scala code:

    pat*

  8. abstract class BlockExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Block(stats, expr). This AST node corresponds to the following Scala code:

    { stats; expr }

    If the block is empty, the expr is set to Literal(Constant(())).

  9. abstract class CaseDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax CaseDef(pat, guard, body). This AST node corresponds to the following Scala code:

    case pat if guard => body

    If the guard is not present, the guard is set to EmptyTree. If the body is not specified, the body is set to Literal(Constant(()))

  10. abstract class ClassDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax ClassDef(mods, name, tparams, impl). This AST node corresponds to the following Scala code:

    mods class name [tparams] impl

    Where impl stands for:

    extends parents { defs }

  11. abstract class CompoundTypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax CompoundTypeTree(templ). This AST node corresponds to the following Scala code:

    parent1 with ... with parentN { refinement }

  12. abstract class DefDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax DefDef(mods, name, tparams, vparamss, tpt, rhs). This AST node corresponds to the following Scala code:

    mods def name[tparams](vparams_1)...(vparams_n): tpt = rhs

    If the return type is not specified explicitly (i.e. is meant to be inferred), this is expressed by having tpt set to TypeTree() (but not to an EmptyTree!).

  13. abstract class ExistentialTypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax ExistentialTypeTree(tpt, whereClauses). This AST node corresponds to the following Scala code:

    tpt forSome { whereClauses }

  14. abstract class FunctionExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Function(vparams, body). This AST node corresponds to the following Scala code:

    vparams => body

    The symbol of a Function is a synthetic TermSymbol. It is the owner of the function's parameters.

  15. abstract class IdentExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Ident(qual, name). This AST node corresponds to the following Scala code:

    name

    Type checker converts idents that refer to enclosing fields or methods to selects. For example, name ==> this.name

  16. abstract class IfExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax If(cond, thenp, elsep). This AST node corresponds to the following Scala code:

    if (cond) thenp else elsep

    If the alternative is not present, the elsep is set to Literal(Constant(())).

  17. abstract class ImportExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Import(expr, selectors). This AST node corresponds to the following Scala code:

    import expr.{selectors}

    Selectors are a list of ImportSelectors, which conceptually are pairs of names (from, to). The last (and maybe only name) may be a nme.WILDCARD. For instance:

    import qual.{x, y => z, _}

    Would be represented as:

    Import(qual, List(("x", "x"), ("y", "z"), (WILDCARD, null)))

    The symbol of an Import is an import symbol @see Symbol.newImport. It's used primarily as a marker to check that the import has been typechecked.

  18. abstract class ImportSelectorExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax ImportSelector(name:, namePos, rename, renamePos). This is not an AST node, it is used as a part of the Import node.

  19. abstract class LabelDefExtractor extends AnyRef

    Permalink

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

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

    This AST node does not have direct correspondence to Scala code. It is used for tailcalls and like. For example, while/do are desugared to label defs as follows:

    while (cond) body ==> LabelDef($L, List(), if (cond) { body; L$() } else ())
    do body while (cond) ==> LabelDef($L, List(), body; if (cond) L$() else ())
  20. abstract class LiteralExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Literal(value). This AST node corresponds to the following Scala code:

    value

  21. abstract class MatchExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Match(selector, cases). This AST node corresponds to the following Scala code:

    selector match { cases }

    Match is also used in pattern matching assignments like val (foo, bar) = baz.

  22. abstract class ModuleDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax ModuleDef(mods, name, impl). This AST node corresponds to the following Scala code:

    mods object name impl

    Where impl stands for:

    extends parents { defs }

  23. abstract class NewExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax New(tpt). This AST node corresponds to the following Scala code:

    new T

    This node always occurs in the following context:

    (new tpt).<init>[targs](args)

    For example, an AST representation of:

    new Example[Int](2)(3)

    is the following code:

    Apply( Apply( TypeApply( Select(New(TypeTree(typeOf[Example])), nme.CONSTRUCTOR) TypeTree(typeOf[Int])), List(Literal(Constant(2)))), List(Literal(Constant(3))))

  24. abstract class PackageDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax PackageDef(pid, stats). This AST node corresponds to the following Scala code:

    package pid { stats }

  25. abstract class RefTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax RefTree(qual, name). This AST node corresponds to either Ident, Select or SelectFromTypeTree.

  26. abstract class ReturnExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Return(expr). This AST node corresponds to the following Scala code:

    return expr

    The symbol of a Return node is the enclosing method.

  27. abstract class SelectExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Select(qual, name). This AST node corresponds to the following Scala code:

    qualifier.selector

    Should only be used with qualifier nodes which are terms, i.e. which have isTerm returning true. Otherwise SelectFromTypeTree should be used instead.

    foo.Bar // represented as Select(Ident(<foo>), <Bar>) Foo#Bar // represented as SelectFromTypeTree(Ident(<Foo>), <Bar>)

  28. abstract class SelectFromTypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax SelectFromTypeTree(qualifier, name). This AST node corresponds to the following Scala code:

    qualifier # selector

    Note: a path-dependent type p.T is expressed as p.type # T

    Should only be used with qualifier nodes which are types, i.e. which have isType returning true. Otherwise Select should be used instead.

    Foo#Bar // represented as SelectFromTypeTree(Ident(<Foo>), <Bar>) foo.Bar // represented as Select(Ident(<foo>), <Bar>)

  29. abstract class SingletonTypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax SingletonTypeTree(ref). This AST node corresponds to the following Scala code:

    ref.type

  30. abstract class StarExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Star(elem). This AST node corresponds to the following Scala code:

    pat*

  31. abstract class SuperExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Super(qual, mix). This AST node corresponds to the following Scala code:

    C.super[M]

    Which is represented as:

    Super(This(C), M)

    If mix is empty, it is tpnme.EMPTY.

    The symbol of a Super is the class _from_ which the super reference is made. For instance in C.super(...), it would be C.

  32. abstract class TemplateExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Template(parents, self, body). This AST node corresponds to the following Scala code:

    extends parents { self => body }

    In case when the self-type annotation is missing, it is represented as an empty value definition with nme.WILDCARD as name and NoType as type.

    The symbol of a template is a local dummy. @see Symbol.newLocalDummy The owner of the local dummy is the enclosing trait or class. The local dummy is itself the owner of any local blocks. For example:

    class C { def foo { // owner is C def bar // owner is local dummy } }

  33. abstract class ThisExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax This(qual). This AST node corresponds to the following Scala code:

    qual.this

    The symbol of a This is the class to which the this refers. For instance in C.this, it would be C.

  34. abstract class ThrowExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Throw(expr). This AST node corresponds to the following Scala code:

    throw expr

  35. abstract class TryExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Try(block, catches, finalizer). This AST node corresponds to the following Scala code:

    try block catch { catches } finally finalizer

    If the finalizer is not present, the finalizer is set to EmptyTree.

  36. abstract class TypeApplyExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax TypeApply(fun, args). This AST node corresponds to the following Scala code:

    fun[args]

    Should only be used with fun nodes which are terms, i.e. which have isTerm returning true. Otherwise AppliedTypeTree should be used instead.

    def foo[T] = ??? foo[Int] // represented as TypeApply(Ident(<foo>), List(TypeTree(<Int>)))

    List[Int] as in val x: List[Int] = ??? // represented as AppliedTypeTree(Ident(<List>), List(TypeTree(<Int>)))

  37. abstract class TypeBoundsTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax TypeBoundsTree(lo, hi). This AST node corresponds to the following Scala code:

    >: lo <: hi

  38. abstract class TypeDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax TypeDef(mods, name, tparams, rhs). This AST node corresponds to the following Scala code:

    mods type name[tparams] = rhs

    mods type name[tparams] >: lo <: hi

    First usage illustrates TypeDefs representing type aliases and type parameters. Second usage illustrates TypeDefs representing abstract types, where lo and hi are both TypeBoundsTrees and Modifier.deferred is set in mods.

  39. abstract class TypeTreeExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax TypeTree(). This AST node does not have direct correspondence to Scala code, and is emitted by everywhere when we want to wrap a Type in a Tree.

  40. abstract class TypedExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax Typed(expr, tpt). This AST node corresponds to the following Scala code:

    expr: tpt

  41. abstract class UnApplyExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax UnApply(fun, args). This AST node does not have direct correspondence to Scala code, and is introduced when typechecking pattern matches and try blocks.

  42. abstract class ValDefExtractor extends AnyRef

    Permalink

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

    An extractor class to create and pattern match with syntax ValDef(mods, name, tpt, rhs). This AST node corresponds to any of the following Scala code:

    mods val name: tpt = rhs

    mods var name: tpt = rhs

    mods name: tpt = rhs // in signatures of function and method definitions

    self: Bar => // self-types

    If the type of a value is not specified explicitly (i.e. is meant to be inferred), this is expressed by having tpt set to TypeTree() (but not to an EmptyTree!).

  1. abstract val Alternative: Universe.AlternativeExtractor

    Permalink

    The constructor/extractor for Alternative instances.

  2. abstract val Annotated: Universe.AnnotatedExtractor

    Permalink

    The constructor/extractor for Annotated instances.

  3. abstract val AppliedTypeTree: Universe.AppliedTypeTreeExtractor

    Permalink

    The constructor/extractor for AppliedTypeTree instances.

  4. abstract val Apply: Universe.ApplyExtractor

    Permalink

    The constructor/extractor for Apply instances.

  5. abstract val Assign: Universe.AssignExtractor

    Permalink

    The constructor/extractor for Assign instances.

  6. abstract val AssignOrNamedArg: Universe.AssignOrNamedArgExtractor

    Permalink

    The constructor/extractor for AssignOrNamedArg instances.

  7. abstract val Bind: Universe.BindExtractor

    Permalink

    The constructor/extractor for Bind instances.

  8. abstract val Block: Universe.BlockExtractor

    Permalink

    The constructor/extractor for Block instances.

  9. abstract val CaseDef: Universe.CaseDefExtractor

    Permalink

    The constructor/extractor for CaseDef instances.

  10. abstract val ClassDef: Universe.ClassDefExtractor

    Permalink

    The constructor/extractor for ClassDef instances.

  11. abstract val CompoundTypeTree: Universe.CompoundTypeTreeExtractor

    Permalink

    The constructor/extractor for CompoundTypeTree instances.

  12. abstract val DefDef: Universe.DefDefExtractor

    Permalink

    The constructor/extractor for DefDef instances.

  13. abstract val ExistentialTypeTree: Universe.ExistentialTypeTreeExtractor

    Permalink

    The constructor/extractor for ExistentialTypeTree instances.

  14. abstract val Function: Universe.FunctionExtractor

    Permalink

    The constructor/extractor for Function instances.

  15. abstract val Ident: Universe.IdentExtractor

    Permalink

    The constructor/extractor for Ident instances.

  16. abstract val If: Universe.IfExtractor

    Permalink

    The constructor/extractor for If instances.

  17. abstract val Import: Universe.ImportExtractor

    Permalink

    The constructor/extractor for Import instances.

  18. abstract val ImportSelector: Universe.ImportSelectorExtractor

    Permalink

    The constructor/extractor for ImportSelector instances.

  19. abstract val LabelDef: Universe.LabelDefExtractor

    Permalink

    The constructor/extractor for LabelDef instances.

  20. abstract val Literal: Universe.LiteralExtractor

    Permalink

    The constructor/extractor for Literal instances.

  21. abstract val Match: Universe.MatchExtractor

    Permalink

    The constructor/extractor for Match instances.

  22. abstract val ModuleDef: Universe.ModuleDefExtractor

    Permalink

    The constructor/extractor for ModuleDef instances.

  23. abstract val New: Universe.NewExtractor

    Permalink

    The constructor/extractor for New instances.

  24. abstract val PackageDef: Universe.PackageDefExtractor

    Permalink

    The constructor/extractor for PackageDef instances.

  25. abstract val RefTree: Universe.RefTreeExtractor

    Permalink

    The constructor/extractor for RefTree instances.

  26. abstract val Return: Universe.ReturnExtractor

    Permalink

    The constructor/extractor for Return instances.

  27. abstract val Select: Universe.SelectExtractor

    Permalink

    The constructor/extractor for Select instances.

  28. abstract val SelectFromTypeTree: Universe.SelectFromTypeTreeExtractor

    Permalink

    The constructor/extractor for SelectFromTypeTree instances.

  29. abstract val SingletonTypeTree: Universe.SingletonTypeTreeExtractor

    Permalink

    The constructor/extractor for SingletonTypeTree instances.

  30. abstract val Star: Universe.StarExtractor

    Permalink

    The constructor/extractor for Star instances.

  31. abstract val Super: Universe.SuperExtractor

    Permalink

    The constructor/extractor for Super instances.

  32. abstract val Template: Universe.TemplateExtractor

    Permalink

    The constructor/extractor for Template instances.

  33. abstract val This: Universe.ThisExtractor

    Permalink

    The constructor/extractor for This instances.

  34. abstract val Throw: Universe.ThrowExtractor

    Permalink

    The constructor/extractor for Throw instances.

  35. abstract val Try: Universe.TryExtractor

    Permalink

    The constructor/extractor for Try instances.

  36. abstract val TypeApply: Universe.TypeApplyExtractor

    Permalink

    The constructor/extractor for TypeApply instances.

  37. abstract val TypeBoundsTree: Universe.TypeBoundsTreeExtractor

    Permalink

    The constructor/extractor for TypeBoundsTree instances.

  38. abstract val TypeDef: Universe.TypeDefExtractor

    Permalink

    The constructor/extractor for TypeDef instances.

  39. abstract val TypeTree: Universe.TypeTreeExtractor

    Permalink

    The constructor/extractor for TypeTree instances.

  40. abstract val Typed: Universe.TypedExtractor

    Permalink

    The constructor/extractor for Typed instances.

  41. abstract val UnApply: Universe.UnApplyExtractor

    Permalink

    The constructor/extractor for UnApply instances.

  42. abstract val ValDef: Universe.ValDefExtractor

    Permalink

    The constructor/extractor for ValDef instances.

Ungrouped

  1. type ModifiersCreator = Universe.ModifiersExtractor

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use ModifiersExtractor instead

  1. abstract val emptyValDef: Universe.ValDef

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use noSelfType instead

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

    Permalink

    Test two objects for inequality.

    Test two objects for inequality.

    returns

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

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

    Permalink

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

    Permalink
    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
  5. def ->[B](y: B): (Trees, B)

    Permalink
    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()
  6. final def ==(arg0: Any): Boolean

    Permalink

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

    Permalink

    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

    Permalink

    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 ensuring(cond: (Trees) ⇒ Boolean, msg: ⇒ Any): Trees

    Permalink
    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
  10. def ensuring(cond: (Trees) ⇒ Boolean): Trees

    Permalink
    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
  11. def ensuring(cond: Boolean, msg: ⇒ Any): Trees

    Permalink
    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: Boolean): Trees

    Permalink
    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. final def eq(arg0: AnyRef): Boolean

    Permalink

    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
  14. def equals(arg0: Any): Boolean

    Permalink

    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
  15. def finalize(): Unit

    Permalink

    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. def formatted(fmtstr: String): String

    Permalink
    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()
  17. final def getClass(): Class[_]

    Permalink

    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

  18. def hashCode(): Int

    Permalink

    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

    Permalink

    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. final def ne(arg0: AnyRef): Boolean

    Permalink

    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
  21. final def notify(): Unit

    Permalink

    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

  22. final def notifyAll(): Unit

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink

    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
  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. def [B](y: B): (Trees, B)

    Permalink
    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