scala.reflect.api

Trees

trait Trees extends AnyRef

Self Type
Universe
Source
Trees.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Trees
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringfmt
  2. by any2stringadd
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbsModifiers extends AnyRef

  2. case class Alternative(trees: List[Tree]) extends Tree with TermTree with Product with Serializable

    Alternatives of patterns, eliminated by explicitouter, except for occurrences in encoded Switch stmt (=remaining Match(CaseDef(.

  3. case class Annotated(annot: Tree, arg: Tree) extends Tree with Product with Serializable

    A tree that has an annotation attached to it.

  4. case class AppliedTypeTree(tpt: Tree, args: List[Tree]) extends Tree with TypTree with Product with Serializable

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

  5. case class Apply(fun: Tree, args: List[Tree]) extends GenericApply with Product with Serializable

    Value application

  6. class ApplyConstructor extends Apply

  7. case class ApplyDynamic(qual: Tree, args: List[Tree]) extends Tree with TermTree with SymTree with Product with Serializable

    Dynamic value application.

  8. class ApplyImplicitView extends Apply

  9. class ApplyToImplicitArgs extends Apply

  10. case class ArrayValue(elemtpt: Tree, elems: List[Tree]) extends Tree with TermTree with Product with Serializable

    Array of expressions, needs to be translated in backend,

  11. case class Assign(lhs: Tree, rhs: Tree) extends Tree with TermTree with Product with Serializable

    Assignment

  12. case class AssignOrNamedArg(lhs: Tree, rhs: Tree) extends Tree with TermTree with Product with Serializable

    Either an assignment or a named argument.

  13. class BackQuotedIdent extends Ident

  14. case class Bind(name: Name, body: Tree) extends DefTree with Product with Serializable

    Bind of a variable to a rhs pattern, eliminated by explicitouter

  15. case class Block(stats: List[Tree], expr: Tree) extends Tree with TermTree with Product with Serializable

    Block of expressions (semicolon separated expressions)

  16. case class CaseDef(pat: Tree, guard: Tree, body: Tree) extends Tree with Product with Serializable

    Case clause in a pattern match, eliminated during explicitouter (except for occurrences in switch statements)

  17. case class ClassDef(mods: Modifiers, name: TypeName, tparams: List[TypeDef], impl: Template) extends ImplDef with Product with Serializable

    A class definition.

  18. class CollectTreeTraverser[T] extends Traverser

  19. case class CompoundTypeTree(templ: Template) extends Tree with TypTree with Product with Serializable

    Intersection type <parent1> with .

  20. case class DefDef(mods: Modifiers, name: Name, tparams: List[TypeDef], vparamss: List[List[ValDef]], tpt: Tree, rhs: Tree) extends ValOrDefDef with Product with Serializable

    A method or macro definition.

  21. abstract class DefTree extends Tree with SymTree with NameTree

    A tree which defines a symbol-carrying entity.

  22. case class ExistentialTypeTree(tpt: Tree, whereClauses: List[Tree]) extends Tree with TypTree with Product with Serializable

  23. class FilterTreeTraverser extends Traverser

  24. class FindTreeTraverser extends Traverser

  25. class ForeachTreeTraverser extends Traverser

  26. case class Function(vparams: List[ValDef], body: Tree) extends Tree with TermTree with SymTree with Product with Serializable

    Anonymous function, eliminated by analyzer

  27. abstract class GenericApply extends Tree with TermTree

    Common base class for Apply and TypeApply.

  28. case class Ident(name: Name) extends Tree with RefTree with Product with Serializable

    Identifier <name>

  29. case class If(cond: Tree, thenp: Tree, elsep: Tree) extends Tree with TermTree with Product with Serializable

    Conditional expression

  30. abstract class ImplDef extends MemberDef

    A common base class for class and object definitions.

  31. case class Import(expr: Tree, selectors: List[ImportSelector]) extends Tree with SymTree with Product with Serializable

    Import clause

  32. case class ImportSelector(name: Name, namePos: Int, rename: Name, renamePos: Int) extends Product with Serializable

    Import selector

  33. case class LabelDef(name: TermName, params: List[Ident], rhs: Tree) extends DefTree with TermTree with Product with Serializable

    A labelled expression.

  34. class LazyTreeCopier extends TreeCopierOps

  35. case class Literal(value: Constant) extends Tree with TermTree with Product with Serializable

    Literal

  36. case class Match(selector: Tree, cases: List[CaseDef]) extends Tree with TermTree with Product with Serializable

    - Pattern matching expression (before explicitouter)

  37. abstract class MemberDef extends DefTree

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

  38. abstract type Modifiers >: Null <: AbsModifiers

  39. case class ModuleDef(mods: Modifiers, name: TermName, impl: Template) extends ImplDef with Product with Serializable

    An object definition, e.

  40. trait NameTree extends Tree

    A tree with a name - effectively, a DefTree or RefTree.

  41. case class New(tpt: Tree) extends Tree with TermTree with Product with Serializable

    Object instantiation One should always use factory method below to build a user level new.

  42. case class PackageDef(pid: RefTree, stats: List[Tree]) extends MemberDef with Product with Serializable

    A packaging, such as package pid { stats }

  43. trait RefTree extends Tree with SymTree with NameTree

    A tree which references a symbol-carrying entity.

  44. case class ReferenceToBoxed(ident: Ident) extends Tree with TermTree with Product with Serializable

    Marks underlying reference to id as boxed.

  45. case class Return(expr: Tree) extends Tree with TermTree with SymTree with Product with Serializable

    Return expression

  46. case class Select(qualifier: Tree, name: Name) extends Tree with RefTree with Product with Serializable

    Designator <qualifier> .

  47. case class SelectFromTypeTree(qualifier: Tree, name: TypeName) extends Tree with TypTree with RefTree with Product with Serializable

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

  48. case class SingletonTypeTree(ref: Tree) extends Tree with TypTree with Product with Serializable

    Singleton type, eliminated by RefCheck

  49. case class Star(elem: Tree) extends Tree with TermTree with Product with Serializable

    Repetition of pattern, eliminated by explicitouter

  50. class StrictTreeCopier extends TreeCopierOps

  51. case class Super(qual: Tree, mix: TypeName) extends Tree with TermTree with Product with Serializable

    Super reference, qual = corresponding this reference A super reference C.

  52. trait SymTree extends Tree

    A tree with a mutable symbol field, initialized to NoSymbol.

  53. case class Template(parents: List[Tree], self: ValDef, body: List[Tree]) extends Tree with SymTree with Product with Serializable

    Instantiation template of a class or trait

  54. trait TermTree extends Tree

    A tree for a term.

  55. case class This(qual: TypeName) extends Tree with TermTree with SymTree with Product with Serializable

    Self reference

  56. case class Throw(expr: Tree) extends Tree with TermTree with Product with Serializable

    Throw expression

  57. abstract class Transformer extends AnyRef

  58. class Traverser extends AnyRef

  59. abstract class Tree extends Product

    Tree is the basis for scala's abstract syntax.

  60. abstract type TreeCopier <: TreeCopierOps

  61. trait TreeCopierOps extends AnyRef

  62. case class Try(block: Tree, catches: List[CaseDef], finalizer: Tree) extends Tree with TermTree with Product with Serializable

  63. trait TypTree extends Tree

    A tree for a type.

  64. case class TypeApply(fun: Tree, args: List[Tree]) extends GenericApply with Product with Serializable

    Explicit type application.

  65. case class TypeBoundsTree(lo: Tree, hi: Tree) extends Tree with TypTree with Product with Serializable

  66. case class TypeDef(mods: Modifiers, name: TypeName, tparams: List[TypeDef], rhs: Tree) extends MemberDef with Product with Serializable

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

  67. case class TypeTree() extends Tree with TypTree with Product with Serializable

    A synthetic tree holding an arbitrary type.

  68. case class Typed(expr: Tree, tpt: Tree) extends Tree with TermTree with Product with Serializable

    Type annotation, eliminated by explicit outer

  69. case class UnApply(fun: Tree, args: List[Tree]) extends Tree with TermTree with Product with Serializable

  70. case class ValDef(mods: Modifiers, name: TermName, tpt: Tree, rhs: Tree) extends ValOrDefDef with Product with Serializable

    Broadly speaking, a value definition.

  71. abstract class ValOrDefDef extends MemberDef

    A common base class for ValDefs and DefDefs.

Abstract Value Members

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

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

  3. abstract def Block(stats: Tree*): Block

    Block factory that flattens directly nested blocks.

  4. abstract def CaseDef(pat: Tree, body: Tree): CaseDef

    casedef shorthand

  5. abstract def ClassDef(sym: Symbol, impl: Template): ClassDef

    sym

    the class symbol

    returns

    the implementation template

  6. abstract def DefDef(sym: Symbol, rhs: (List[List[Symbol]]) ⇒ Tree): DefDef

  7. abstract def DefDef(sym: Symbol, rhs: Tree): DefDef

  8. abstract def DefDef(sym: Symbol, mods: Modifiers, rhs: Tree): DefDef

  9. abstract def DefDef(sym: Symbol, vparamss: List[List[ValDef]], rhs: Tree): DefDef

  10. abstract def DefDef(sym: Symbol, mods: Modifiers, vparamss: List[List[ValDef]], rhs: Tree): DefDef

  11. abstract def Ident(sym: Symbol): Ident

  12. abstract def Ident(name: String): Ident

  13. abstract def LabelDef(sym: Symbol, params: List[Symbol], rhs: Tree): LabelDef

  14. abstract def Modifiers(mods: Set[Modifier] = Set(), privateWithin: Name = EmptyTypeName, annotations: List[Tree] = List()): Modifiers

  15. abstract def ModuleDef(sym: Symbol, impl: Template): ModuleDef

    sym

    the class symbol

    impl

    the implementation template

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

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

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

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

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

  19. abstract val NoMods: Modifiers

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

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

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

  23. abstract def This(sym: Symbol): Tree

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

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

  26. abstract def TypeDef(sym: Symbol): TypeDef

    A TypeDef node which defines abstract type or type parameter for given sym

  27. abstract def TypeDef(sym: Symbol, rhs: Tree): TypeDef

    A TypeDef node which defines given sym with given tight hand side rhs.

  28. abstract def ValDef(sym: Symbol): ValDef

  29. abstract def ValDef(sym: Symbol, rhs: Tree): ValDef

  30. abstract def duplicateTree(tree: Tree): Tree

    Attributes
    protected
  31. abstract def emptyValDef: 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.

  32. abstract def newLazyTreeCopier: TreeCopier

  33. abstract def newStrictTreeCopier: TreeCopier

Concrete Value Members

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

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

    Test two objects for inequality.

    Test two objects for inequality.

    returns

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

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

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

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

    returns

    a hash value consistent with ==

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

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

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

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Test two objects for equality.

    Test two objects for equality. 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
    Any
  8. object EmptyTree extends Tree with TermTree with Product with Serializable

    The empty tree

  9. def TypeTree(tp: Type): TypeTree

  10. final def asInstanceOf[T0]: T0

    Cast the receiver object to be of type T0.

    Cast the receiver object to be of type T0.

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

    returns

    the receiver object.

    Definition Classes
    Any
    Exceptions thrown
    ClassCastException

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

  11. def clone(): AnyRef

    Create a copy of the receiver object.

    Create a copy of the receiver object.

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object.

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

    not specified by SLS as a member of AnyRef

  12. def copyClassDef(tree: Tree)(mods: Modifiers = null, name: Name = null, tparams: List[TypeDef] = null, impl: Template = null): ClassDef

  13. def copyDefDef(tree: Tree)(mods: Modifiers = null, name: Name = null, tparams: List[TypeDef] = null, vparamss: List[List[ValDef]] = null, tpt: Tree = null, rhs: Tree = null): DefDef

  14. def copyValDef(tree: Tree)(mods: Modifiers = null, name: Name = null, tpt: Tree = null, rhs: Tree = null): ValDef

  15. def deriveCaseDef(cdef: Tree)(applyToBody: (Tree) ⇒ Tree): CaseDef

  16. def deriveClassDef(cdef: Tree)(applyToImpl: (Template) ⇒ Template): ClassDef

  17. def deriveDefDef(ddef: Tree)(applyToRhs: (Tree) ⇒ Tree): DefDef

  18. def deriveLabelDef(ldef: Tree)(applyToRhs: (Tree) ⇒ Tree): LabelDef

  19. def deriveModuleDef(mdef: Tree)(applyToImpl: (Template) ⇒ Template): ModuleDef

  20. def deriveTemplate(templ: Tree)(applyToBody: (List[Tree]) ⇒ List[Tree]): Template

  21. def deriveValDef(vdef: Tree)(applyToRhs: (Tree) ⇒ Tree): ValDef

  22. 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 any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: (Trees) ⇒ Boolean): Trees

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

    Implicit information
    This member is added by an implicit conversion from Trees to Ensuring[Trees] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  26. final def eq(arg0: AnyRef): Boolean

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

    Tests whether the argument (arg0) 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
  27. def equals(arg0: Any): Boolean

    The equality method for reference types.

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

    See also equals in Any.

    returns

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

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

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

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

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

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

    not specified by SLS as a member of AnyRef

  29. def formatted(fmtstr: String): String

    Returns string formatted according to given format string.

    Returns string formatted according to given format string. Format strings are as for String.format (@see java.lang.String.format).

    Implicit information
    This member is added by an implicit conversion from Trees to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  30. final def getClass(): Class[_]

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

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

    The nature of the representation is platform dependent.

    returns

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

    Definition Classes
    AnyRef → Any
    Note

    not specified by SLS as a member of AnyRef

  31. def hashCode(): Int

    The hashCode method for reference types.

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

    returns

    the hash code value for this object.

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

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

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

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

    returns

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

    Definition Classes
    Any
  33. final def ne(arg0: AnyRef): Boolean

    Equivalent to !(this eq that).

    Equivalent to !(this eq that).

    returns

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

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

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

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

    Definition Classes
    AnyRef
    Note

    not specified by SLS as a member of AnyRef

  35. final def notifyAll(): Unit

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

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

    Definition Classes
    AnyRef
    Note

    not specified by SLS as a member of AnyRef

  36. val self: Any

    Implicit information
    This member is added by an implicit conversion from Trees to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
  37. val self: Any

    Implicit information
    This member is added by an implicit conversion from Trees to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  39. def toString(): String

    Creates a String representation of this object.

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

    returns

    a String representation of the object.

    Definition Classes
    AnyRef → Any
  40. val treeCopy: TreeCopier

  41. final def wait(): Unit

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

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

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

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

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

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

Deprecated Value Members

  1. def x: Trees

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

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Trees

    Implicit information
    This member is added by an implicit conversion from Trees to Ensuring[Trees] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringfmt from Trees to StringFormat

Inherited by implicit conversion any2stringadd from Trees to StringAdd

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

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