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
- Alphabetic
- By Inheritance
- TreeBuilder
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TreeBuilder()
Abstract Value Members
- abstract val global: Global
- abstract def source: SourceFile
- abstract def unit: Global.CompilationUnit
Concrete Value Members
- def addEvidenceParams(owner: Global.Name, vparamss: List[List[Global.ValDef]], contextBounds: List[Global.Tree]): List[List[Global.ValDef]]
Append implicit parameter section if
contextBounds
nonempty - def byNameApplication(tpe: Global.Tree): Global.Tree
- def convertToTypeName(t: Global.Tree): Option[Global.RefTree]
- implicit def fresh: FreshNameCreator
- def makeAlternative(ts: List[Global.Tree]): Global.Tree
Create tree for a pattern alternative
- def makeAnnotated(t: Global.Tree, annot: Global.Tree): Global.Tree
- def makeBlock(stats: List[Global.Tree]): Global.Tree
Create block of statements
stats
- def makeCaseDef(pat: Global.Tree, guard: Global.Tree, rhs: Global.Tree): Global.CaseDef
Create tree for case definition <case pat if guard => rhs>
- def makeCatchFromExpr(catchExpr: Global.Tree): Global.CaseDef
Creates tree representing: { case x: Throwable => val catchFn = catchExpr if (catchFn isDefinedAt x) catchFn(x) else throw x }
- def makeCatchFromFunc(catchFn: Global.Tree): Global.CaseDef
Creates tree representing: { case x: Throwable => catchExpr(x) }
- def makeDoWhile(lname: Global.TermName, body: Global.Tree, cond: Global.Tree): Global.Tree
Create tree representing a do-while loop
- def makeFunctionTypeTree(argtpes: List[Global.Tree], restpe: Global.Tree): Global.Tree
Create a tree representing the function type (argtpes) => restpe
- def makeImportSelector(name: Global.Name, nameOffset: Int): Global.ImportSelector
- def makeMatchFromExpr(catchExpr: Global.Tree): List[Global.CaseDef]
At parser, rejigger non-case catch expression.
At parser, rejigger non-case catch expression.
Match is eliminated by unwrapping. Other expression becomes a single CaseDef with empty pattern and expr tree as RHS.
- def makeParam(pname: Global.TermName, tpe: Global.Tree): Global.ValDef
- def makePatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree, rhsPos: Global.Position): List[Global.ValDef]
- final def makePatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree): List[Global.ValDef]
- def makePostfixSelect(start: Int, end: Int, od: Global.Tree, op: Global.Name): Global.Tree
Tree for
od op
, start is start0 if od.pos is borked. - def makeSelfDef(name: Global.TermName, tpt: Global.Tree): Global.ValDef
- def makeSyntheticTypeParam(pname: Global.TypeName, bounds: Global.Tree): Global.TypeDef
- def makeTupleTerm(elems: List[Global.Tree]): Global.Tree
- def makeTupleType(elems: List[Global.Tree]): Global.Tree
- def makeWhile(startPos: Int, cond: Global.Tree, body: Global.Tree): Global.Tree
Create tree representing a while loop
- def o2p(offset: Int): Global.Position
- def r2p(start: Int, mid: Int, end: Int): Global.Position
- def repeatedApplication(tpe: Global.Tree): Global.Tree
- def rootScalaDot(name: Global.Name): Global.Select
- def scalaAnyRefConstr: Global.Select
- def scalaDot(name: Global.Name): Global.Select
- def scalaUnitConstr: Global.Select
The Scala compiler and reflection APIs.