scala.tools.nsc.ast.parser

TreeBuilder

abstract class TreeBuilder extends AnyRef

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

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. abstract class Enumerator extends AnyRef

  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. abstract def freshName(prefix: String): Name

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

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

  4. abstract val global: Global

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

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

Concrete Value Members

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  61. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any