trait Trees extends AnyRef

Self Type
Universe
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Trees
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbsModifiers extends AnyRef
  2. case class Alternative (trees: List[Universe.Tree]) extends Universe.Tree with Universe.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: Universe.Tree, arg: Universe.Tree) extends Universe.Tree with Product with Serializable

    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.

  4. abstract type AnnotationType
  5. case class AnonFunc (vparamss: List[List[Universe.ValDef]], tpt: Universe.Tree, rhs: Universe.Tree) extends Universe.Tree with Universe.FuncTree with Product with Serializable
  6. case class AppliedTypeTree (tpt: Universe.Tree, args: List[Universe.Tree]) extends Universe.Tree with Universe.TypTree with Product with Serializable

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

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

    Value application

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

    Dynamic value application.

    Dynamic value application. In a dynamic application q.f(as)

    • q is stored in qual
    • as is stored in args
    • f is stored as the node's symbol field.
  9. class ApplyImplicitView extends Universe.Apply
  10. class ApplyToImplicitArgs extends Universe.Apply
  11. case class ArrayValue (elemtpt: Universe.Tree, elems: List[Universe.Tree]) extends Universe.Tree with Universe.TermTree with Product with Serializable

    Array of expressions, needs to be translated in backend,

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

    Assignment

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

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

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

    Block of expressions (semicolon separated expressions)

  16. case class CaseDef (pat: Universe.Tree, guard: Universe.Tree, body: Universe.Tree) extends Universe.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: Universe.Modifiers, ctormods: Universe.Modifiers, name: Universe.TypeName, tparams: List[Universe.TypeDef], vparams: List[Universe.ValDef], impl: Universe.Template) extends Universe.ImplDef with Product with Serializable

    A class definition.

  18. case class Commented (mods: Universe.Modifiers, comment: List[String], expr: Universe.Tree) extends Universe.Tree with Product with Serializable

    Commented expression

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

    Intersection type <parent1> with ...

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

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

    A method or macro definition.

    A method or macro definition.

    name

    The name of the method or macro. Can be a type name in case this is a type macro

  21. abstract class DefTree extends Universe.Tree with Universe.SymTree

    A tree which defines a symbol-carrying entity.

  22. sealed trait Enumerator extends Universe.Tree
  23. case class ExistentialTypeTree (tpt: Universe.Tree, whereClauses: List[Universe.Tree]) extends Universe.Tree with Universe.TypTree with Product with Serializable
  24. class FilterTreeTraverser extends Universe.Traverser
  25. class FindTreeTraverser extends Universe.Traverser
  26. case class ForFilter (pos: Position, test: Universe.Tree) extends Universe.Tree with Universe.Enumerator with Product with Serializable
  27. case class ForTree (enums: List[Universe.Enumerator], body: Universe.Tree) extends Universe.Tree with Product with Serializable
  28. case class ForValDef (pos: Position, name: Universe.TermName, tpt: Universe.Tree, rhs: Universe.Tree) extends Universe.ValOrDefDef with Universe.Enumerator with Product with Serializable
  29. case class ForValFrom (pos: Position, name: Universe.TermName, tpt: Universe.Tree, rhs: Universe.Tree) extends Universe.ValOrDefDef with Universe.Enumerator with Product with Serializable
  30. case class ForYieldTree (enums: List[Universe.Enumerator], body: Universe.Tree) extends Universe.Tree with Product with Serializable
  31. class ForeachTreeTraverser extends Universe.Traverser
  32. trait FuncTree extends Universe.Tree with Universe.TermTree

    A tree for a function expression.

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

    Anonymous function, eliminated by analyzer

  34. abstract class GenericApply extends Universe.Tree with Universe.TermTree

    Common base class for Apply and TypeApply.

    Common base class for Apply and TypeApply. This could in principle be a SymTree, but whether or not a Tree is a SymTree isn't used to settle any interesting questions, and it would add a useless field to all the instances (useless, since GenericApply forwards to the underlying fun.)

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

    Identifier <name>

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

    Conditional expression

  37. abstract class ImplDef extends Universe.MemberDef

    A common base class for class and object definitions.

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

    Import clause

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

    Import selector

    Import selector

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

    name

    the imported name

    namePos

    its position or -1 if undefined

    rename

    the name the import is renamed to (== name if no renaming)

    renamePos

    the position of the rename or -1 if undefined

  40. case class Infix (qualifier: Universe.Tree, name: Universe.Name, args: List[Universe.Tree]) extends Universe.Tree with Product with Serializable

    Infix application

  41. case class InfixUnApply (qualifier: Universe.Tree, name: Universe.Name, args: List[Universe.Tree]) extends Universe.Tree with Product with Serializable

    Infix extraction, for example case x :: rest

  42. case class Interpolated (interpolator: Universe.Name, args: List[Universe.Tree]) extends Universe.Tree with Product with Serializable
  43. case class LabelDef (name: Universe.TermName, param: Universe.Tree, rhs: Universe.Tree) extends Universe.DefTree with Universe.TermTree with Product with Serializable

    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.

  44. class LazyTreeCopier extends Universe.TreeCopierOps
  45. case class Literal (value: Universe.Constant) extends Universe.Tree with Universe.TermTree with Product with Serializable

    Literal

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

    - Pattern matching expression (before explicitouter)

    - Pattern matching expression (before explicitouter)

    • Switch statements (after explicitouter)

    After explicitouter, 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)
  47. abstract class MemberDef extends Universe.DefTree

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

  48. abstract type Modifiers <: Universe.AbsModifiers
  49. case class ModuleDef (mods: Universe.Modifiers, name: Universe.TermName, impl: Universe.Template) extends Universe.ImplDef with Product with Serializable

    An object definition, e.g.

    An object definition, e.g. object Foo. Internally, objects are quite frequently called modules to reduce ambiguity.

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

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

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

    tpt

    a class type

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

    A packaging, such as package pid { stats }

  52. case class ProcDef (mods: Universe.Modifiers, name: Universe.Name, tparams: List[Universe.TypeDef], vparamss: List[List[Universe.ValDef]], rhs: Universe.Tree) extends Universe.MemberDef with Product with Serializable

    A procedure definition.

    A procedure definition. Sugar for a function whose return type is Unit.

    name

    The name of the method or macro. Can be a type name in case this is a type macro

  53. trait RefTree extends Universe.Tree with Universe.SymTree

    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.

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

    Return expression

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

    Designator <qualifier> .

    Designator <qualifier> . <name>

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

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

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

    Singleton type, eliminated by RefCheck

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

    Repetition of pattern, eliminated by explicitouter

  59. class StrictTreeCopier extends Universe.TreeCopierOps
  60. case class Super (qual: Universe.Tree, mix: Universe.TypeName) extends Universe.Tree with Universe.TermTree with Product with Serializable

    Super reference, qual = corresponding this reference

  61. trait SymTree extends Universe.Tree

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

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

    Instantiation template of a class or trait

  63. trait TermTree extends Universe.Tree

    A tree for a term.

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

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

    Self reference

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

    Throw expression

  66. class Traverser extends AnyRef
  67. abstract class Tree extends Product

    Tree is the basis for scala's abstract syntax.

    Tree is the basis for scala's abstract syntax. The nodes are implemented as case classes, and the parameters which initialize a given tree are immutable: however Trees have several mutable fields which are manipulated in the course of typechecking, including pos, symbol, and tpe.

    Newly instantiated trees have tpe set to null (though it may be set immediately thereafter depending on how it is constructed.) When a tree is passed to the typer, typically via typer.typed(tree), under normal circumstances the tpe must be null or the typer will ignore it. Furthermore, the typer is not required to return the same tree it was passed.

    Trees can be easily traversed with e.g. foreach on the root node; for a more nuanced traversal, subclass Traverser. Transformations can be considerably trickier: see the numerous subclasses of Transformer found around the compiler.

    Copying Trees should be done with care depending on whether it need be done lazily or strictly (see LazyTreeCopier and StrictTreeCopier) and on whether the contents of the mutable fields should be copied. The tree copiers will copy the mutable attributes to the new tree; calling Tree#duplicate will copy symbol and tpe, but all the positions will be focused.

    Trees can be coarsely divided into four mutually exclusive categories:

    • TermTrees, representing terms
    • TypTrees, representing types. Note that is TypTree, not TypeTree.
    • SymTrees, which may represent types or terms.
    • Other Trees, which have none of those as parents.

    SymTrees include important nodes Ident and Select, which are used as both terms and types; they are distinguishable based on whether the Name is a TermName or TypeName. The correct way for to test for a type or a term (on any Tree) are the isTerm/isType methods on Tree.

    "Others" are mostly syntactic or short-lived constructs. Examples include CaseDef, which wraps individual match cases: they are neither terms nor types, nor do they carry a symbol. Another example is Parens, which is eliminated during parsing.

  68. abstract type TreeCopier <: Universe.TreeCopierOps
  69. trait TreeCopierOps extends AnyRef
  70. case class Try (block: Universe.Tree, catches: List[Universe.CaseDef], finalizer: Universe.Tree) extends Universe.Tree with Universe.TermTree with Product with Serializable
  71. trait TypTree extends Universe.Tree

    A tree for a type.

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

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

    Explicit type application.

    Explicit type application. All signs point toward it being a requirement that args.nonEmpty, but I can't find that explicitly stated anywhere. Unless your last name is odersky, you should probably treat it as true.

  73. case class TypeBoundsTree (lo: Universe.Tree, hi: Universe.Tree) extends Universe.Tree with Universe.TypTree with Product with Serializable
  74. case class TypeDef (mods: Universe.Modifiers, name: Universe.TypeName, tparams: List[Universe.TypeDef], rhs: Universe.Tree) extends Universe.MemberDef with Product with Serializable

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

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

    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.

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

    Type annotation, eliminated by explicit outer

  77. case class UnApply (fun: Universe.Tree, args: List[Universe.Tree]) extends Universe.Tree with Universe.TermTree with Product with Serializable
  78. case class ValDef (mods: Universe.Modifiers, lhs: Universe.Tree, rhs: Universe.Tree) extends Universe.ValOrDefDef with Product with Serializable

    A constant value definition (this includes vars as well, which differ from vals only in having the MUTABLE flag set in their Modifiers.)

  79. abstract class ValOrDefDef extends Universe.MemberDef

    A common base class for ValDefs and DefDefs.

Abstract Value Members

  1. abstract def Modifiers(mods: Set[Modifier.Value] = Set(), privateWithin: Universe.Name = EmptyTypeName, annotations: List[Universe.AnnotationInfo] = List()): Universe.Modifiers
  2. abstract def emptyValDef: Universe.ValDef
  3. abstract def newLazyTreeCopier: Universe.TreeCopier
  4. abstract def newStrictTreeCopier: Universe.TreeCopier

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def BackQuotedIdent(sym: Universe.Symbol): Universe.BackQuotedIdent
  5. def ForFilter(test: Universe.Tree): Universe.ForFilter
  6. def ForValDef(name: Universe.TermName, tpt: Universe.Tree, rhs: Universe.Tree): Universe.ForValDef
  7. def ForValFrom(name: Universe.TermName, tpt: Universe.Tree, rhs: Universe.Tree): Universe.ForValFrom
  8. def Ident(sym: Universe.Symbol): Universe.Ident
  9. def Infix(qualifier: Universe.Tree, sym: Universe.Symbol, args: List[Universe.Tree]): Universe.Infix
  10. def InfixUnApply(qualifier: Universe.Tree, sym: Universe.Symbol, args: List[Universe.Tree]): Universe.InfixUnApply
  11. def Interpolated(sym: Universe.Symbol, args: List[Universe.Tree]): Universe.Interpolated
  12. def Select(qualifier: Universe.Tree, sym: Universe.Symbol): Universe.Select
  13. def TypeTree(tp: Universe.Type): Universe.TypeTree
  14. def ValDef(mods: Universe.Modifiers, name: Universe.Name, tpt: Universe.Tree, rhs: Universe.Tree): Universe.ValDef
  15. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  16. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. val treeCopy: Universe.TreeCopier
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def xtraverse(traverser: Universe.Traverser, tree: Universe.Tree): Unit
    Attributes
    protected
  33. object BackQuotedIdent extends Serializable
  34. object EmptyTree extends Universe.Tree with Universe.TermTree with Product with Serializable

    The empty tree

Inherited from AnyRef

Inherited from Any

Ungrouped