scala.tools.nsc.ast.parser

TreeBuilder

class TreeBuilder extends AnyRef

Methods for building trees, used in the parser. All the trees returned by this class must be untyped.

Attributes
abstract
Source
TreeBuilder.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. TreeBuilder
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeBuilder ()

Type Members

  1. class Enumerator extends AnyRef

    Attributes
    abstract
  2. case class Filter (pos: Position, test: Tree) extends Enumerator with Product with Serializable

  3. class GetVarTraverser extends Traverser

    Traverse pattern and collect all variable names with their types in buffer The variables keep their positions; whereas the pattern is converted to be synthetic for all nodes that contain a variable position.

  4. case class ValEq (pos: Position, pat: Tree, rhs: Tree) extends Enumerator with Product with Serializable

  5. case class ValFrom (pos: Position, pat: Tree, rhs: Tree) extends Enumerator with Product with Serializable

Abstract Value Members

  1. def freshName (prefix: String): Name

    Attributes
    abstract
  2. def freshTermName (prefix: String): TermName

    Attributes
    abstract
  3. def freshTypeName (prefix: String): TypeName

    Attributes
    abstract
  4. val global : Global

    Attributes
    abstract
  5. def o2p (offset: Int): Position

    Attributes
    abstract
  6. def r2p (start: Int, point: Int, end: Int): Position

    Attributes
    abstract

Concrete Value Members

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  6. def addEvidenceParams (owner: Name, vparamss: List[List[ValDef]], contextBounds: List[Tree]): List[List[ValDef]]

    Append implicit parameter section if contextBounds' nonempty

  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. def byNameApplication (tpe: Tree): Tree

  9. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def convertToTypeName (t: Tree): Option[RefTree]

  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def freshName (): Name

  15. def freshTermName (): TermName

  16. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  17. def hashCode (): Int

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

    Attributes
    final
    Definition Classes
    Any
  19. def makeAlternative (ts: List[Tree]): Tree

    Create tree for a pattern alternative

  20. def makeAnnotated (t: Tree, annot: Tree): Tree

  21. def makeAssign (lhs: Tree, rhs: Tree): Tree

    Create a tree representing an assignment <lhs = rhs>

  22. def makeBinop (isExpr: Boolean, left: Tree, op: TermName, right: Tree, opPos: Position): Tree

    Create tree representing (unencoded) binary operation expression or pattern.

  23. def makeBlock (stats: List[Tree]): Tree

    Create block of statements stats'

  24. def makeCaseDef (pat: Tree, guard: Tree, rhs: Tree): CaseDef

    Create tree for case definition <case pat if guard => rhs>

  25. def makeCatchFromExpr (catchExpr: Tree): CaseDef

    Creates tree representing: { case x: Throwable => val catchFn = catchExpr if (catchFn isDefinedAt x) catchFn(x) else throw x }

  26. def makeDoWhile (lname: TermName, body: Tree, cond: Tree): Tree

    Create tree representing a do-while loop

  27. def makeFor (enums: List[Enumerator], body: Tree): Tree

    Create tree for for-do comprehension <for (enums) body>

  28. def makeForYield (enums: List[Enumerator], body: Tree): Tree

    Create tree for for-yield comprehension <for (enums) yield body>

  29. def makeFunctionTypeTree (argtpes: List[Tree], restpe: Tree): Tree

    Create a tree representing the function type (argtpes) => restpe

  30. def makeGenerator (pos: Position, pat: Tree, valeq: Boolean, rhs: Tree): Enumerator

    Create tree for for-comprehension generator <val pat0 <- rhs0>

  31. def makeImportSelector (name: Name, nameOffset: Int): ImportSelector

  32. def makeIntersectionTypeTree (tps: List[Tree]): Tree

    A type tree corresponding to (possibly unary) intersection type

  33. def makeLifted (gs: List[ValFrom], body: Tree): Tree

    Create tree for a lifted expression XX-LIFTING

  34. def makeNew (parents: List[Tree], self: ValDef, stats: List[Tree], argss: List[List[Tree]], npos: Position, cpos: Position): Tree

    Create positioned tree representing an object creation <new parents { stats }

    Create positioned tree representing an object creation <new parents { stats }

    npos

    the position of the new

    cpos

    the position of the anonymous class starting with parents

  35. def makeParam (pname: TermName, tpe: Tree): ValDef

  36. def makePatDef (mods: Modifiers, pat: Tree, rhs: Tree): List[Tree]

    Create tree for pattern definition <mods val pat0 = rhs>

  37. def makePatDef (pat: Tree, rhs: Tree): List[Tree]

    Create tree for pattern definition <val pat0 = rhs>

  38. def makeSelfDef (name: TermName, tpt: Tree): ValDef

  39. def makeSequencedMatch (selector: Tree, cases: List[CaseDef]): Tree

    For debugging only.

    For debugging only. Desugar a match statement like so: val x = scrutinee x match { case case1 => ... case _ => x match { case case2 => ... case _ => x match ... } }

    This way there are never transitions between nontrivial casedefs. Of course many things break: exhaustiveness and unreachable checking do not work, no switches will be generated, etc.

  40. def makeSyntheticParam (pname: TermName): ValDef

  41. def makeSyntheticTypeParam (pname: TypeName, bounds: Tree): TypeDef

  42. def makeTupleTerm (trees: List[Tree], flattenUnary: Boolean): Tree

  43. def makeTupleType (trees: List[Tree], flattenUnary: Boolean): Tree

  44. def makeVisitor (cases: List[CaseDef], checkExhaustive: Boolean, prefix: String): Tree

    Create visitor <x => x match cases>

  45. def makeVisitor (cases: List[CaseDef], checkExhaustive: Boolean): Tree

    Create visitor <x => x match cases>

  46. def makeWhile (lname: TermName, cond: Tree, body: Tree): Tree

    Create tree representing a while loop

  47. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  48. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  49. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  50. def productConstr : Select

  51. def repeatedApplication (tpe: Tree): Tree

  52. def rootId (name: Name): Select

  53. def rootScalaDot (name: Name): Select

  54. def scalaAnyRefConstr : Select

  55. def scalaDot (name: Name): Select

  56. def scalaScalaObjectConstr : Select

  57. def scalaUnitConstr : Select

  58. def serializableConstr : Select

  59. def stripParens (t: Tree): Tree

  60. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  61. def toString (): String

    Definition Classes
    AnyRef → Any
  62. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any