abstract class TreeGen extends reflect.internal.TreeGen with TreeDSL
XXX to resolve: TreeGen only assumes global is a SymbolTable, but TreeDSL at the moment expects a Global. Can we get by with SymbolTable?
- Source
- TreeGen.scala
- Alphabetic
- By Inheritance
- TreeGen
- TreeDSL
- TreeGen
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TreeGen()
Type Members
-
class
GetVarTraverser extends reflect.internal.SymbolTable.Traverser
- Definition Classes
- TreeGen
Concrete Value Members
-
object
CODE
- Definition Classes
- TreeDSL
-
final
def
!=(arg0: Any): Boolean
Test two objects for inequality.
Test two objects for inequality.
- returns
true
if !(this == that), false otherwise.
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
Equivalent to
x.hashCode
except for boxed numeric types andnull
.Equivalent to
x.hashCode
except for boxed numeric types andnull
. 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. Fornull
returns a hashcode wherenull.hashCode
throws aNullPointerException
.- returns
a hash value consistent with ==
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (TreeGen, B)
-
final
def
==(arg0: Any): Boolean
The expression
x == that
is equivalent toif (x eq null) that eq null else x.equals(that)
.The expression
x == that
is equivalent toif (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
- AnyRef → Any
-
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 aClassCastException
at runtime, while the expressionList(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 typeT0
.
-
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- Note
not specified by SLS as a member of AnyRef
-
def
convertToSelectFromType(qual: Global.Tree, origName: Global.Name): Global.Tree with Serializable
Try to convert Select(qual, name) to a SelectFromTypeTree.
-
def
convertToTypeName(tree: Global.Tree): Option[Global.RefTree]
Translate names in Select/Ident nodes to type names.
- def ensuring(cond: (TreeGen) ⇒ Boolean, msg: ⇒ Any): TreeGen
- def ensuring(cond: (TreeGen) ⇒ Boolean): TreeGen
- def ensuring(cond: Boolean, msg: ⇒ Any): TreeGen
- def ensuring(cond: Boolean): TreeGen
-
final
def
eq(arg0: AnyRef): Boolean
Tests whether the argument (
that
) is a reference to the receiver object (this
).Tests whether the argument (
that
) is a reference to the receiver object (this
).The
eq
method implements an equivalence relation on non-null instances ofAnyRef
, and has three additional properties:- It is consistent: for any non-null instances
x
andy
of typeAnyRef
, multiple invocations ofx.eq(y)
consistently returnstrue
or consistently returnsfalse
. - For any non-null instance
x
of typeAnyRef
,x.eq(null)
andnull.eq(x)
returnsfalse
. null.eq(null)
returnstrue
.
When overriding the
equals
orhashCode
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
- It is consistent: for any non-null instances
-
def
equals(arg0: Any): Boolean
The equality method for reference types.
-
def
evalOnce(expr: Global.Tree, owner: Global.Symbol, unit: Global.CompilationUnit)(within: (() ⇒ Global.Tree) ⇒ Global.Tree): Global.Tree
Used in situations where you need to access value of an expression several times
- def evalOnceAll(exprs: List[Global.Tree], owner: Global.Symbol, unit: Global.CompilationUnit)(within: (List[() ⇒ Global.Tree]) ⇒ Global.Tree): Global.Tree
- def expandFunction(localTyper: (analyzer)#Typer)(fun: Global.Function, inConstructorFlag: Long): Global.Tree
-
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 betweenfinalize
and non-local returns and exceptions, are all platform dependent.- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- Note
not specified by SLS as a member of AnyRef
- def formatted(fmtstr: String): String
- def functionClassType(fun: Global.Function): Global.Type
-
final
def
getClass(): Class[_]
Returns the runtime class representation of the object.
Returns the runtime class representation of the object.
- returns
a class object corresponding to the runtime type of the receiver.
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
The hashCode method for reference types.
-
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 returnfalse
, while the expressionList(1).isInstanceOf[List[String]]
will returntrue
. 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 typeT0
;false
otherwise.
- Definition Classes
- Any
-
def
maybeMkAsInstanceOf(tree: Global.Tree, pt: Global.Type, tpe: Global.Type, beforeRefChecks: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAnd(tree1: Global.Tree, tree2: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAnonymousNew(stats: List[Global.Tree]): Global.Tree
Creates a tree representing new Object { stats }.
Creates a tree representing new Object { stats }. To make sure an anonymous subclass of Object is created, if there are no stats, a () is added.
- def mkAppliedTypeForCase(clazz: Global.Symbol): Global.Tree
-
def
mkAppliedTypeTree(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkApplyIfNeeded(qual: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAssign(lhs: Global.Tree, rhs: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
- def mkAssignAndReturn(lhs: Global.Symbol, rhs: Global.Tree): Global.Tree
-
def
mkAttributedIdent(sym: Global.Symbol): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkAttributedQualifier(tpe: Global.Type, termSym: Global.Symbol): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAttributedQualifier(tpe: Global.Type): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAttributedQualifierIfPossible(prefix: Global.Type): Option[Global.Tree]
- Definition Classes
- TreeGen
-
def
mkAttributedRef(sym: Global.Symbol): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkAttributedRef(pre: Global.Type, sym: Global.Symbol): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkAttributedSelect(qual: Global.Tree, sym: Global.Symbol): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkAttributedStableRef(sym: Global.Symbol): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAttributedStableRef(pre: Global.Type, sym: Global.Symbol): Global.Tree
- Definition Classes
- TreeGen
-
def
mkAttributedThis(sym: Global.Symbol): Global.This
- Definition Classes
- TreeGen
-
def
mkAttributedTypeApply(target: Global.Tree, method: Global.Symbol, targs: List[Global.Type]): Global.Tree
- Definition Classes
- TreeGen
- def mkBindForCase(patVar: Global.Symbol, clazz: Global.Symbol, targs: List[Global.Type]): Global.Tree
-
def
mkBlock(stats: List[Global.Tree], doFlatten: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
mkCast(tree: Global.Tree, pt: Global.Type): Global.Tree
Cast
tree
to typept
by creating one of the calls of the formCast
tree
to typept
by creating one of the calls of the formx.asInstanceOf[
pt
] up to phase uncurry x.asInstanceOf[pt
]() if after uncurry but before erasure x.$asInstanceOf[pt
]() if at or after erasure- Definition Classes
- TreeGen → TreeGen
-
def
mkCastArray(tree: Global.Tree, elemtp: Global.Type, pt: Global.Type): Global.Tree
Generate a cast for tree Tree representing Array with elem type elemtp to expected type pt.
- def mkCastPreservingAnnotations(tree: Global.Tree, pt: Global.Type): Global.Typed
-
def
mkCheckIfRefutable(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
- Definition Classes
- TreeGen
-
def
mkClassDef(mods: Global.Modifiers, name: Global.TypeName, tparams: List[Global.TypeDef], templ: Global.Template): Global.ClassDef
- Definition Classes
- TreeGen
-
def
mkClassOf(tp: Global.Type): Global.Tree
- Definition Classes
- TreeGen
-
def
mkConstantZero(tp: Global.Type): Global.Constant
- Definition Classes
- TreeGen
-
def
mkFor(enums: List[Global.Tree], sugarBody: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
- Definition Classes
- TreeGen
-
def
mkForwarder(target: Global.Tree, vparamss: List[List[Global.Symbol]]): Global.Tree
Make forwarder to method
target
, passing all parameters inparams
-
def
mkFunctionTypeTree(argtpes: List[Global.Tree], restpe: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkGenerator(pos: Global.Position, pat: Global.Tree, valeq: Boolean, rhs: Global.Tree)(implicit fresh: FreshNameCreator): Global.Tree
- Definition Classes
- TreeGen
-
def
mkImport(qualSym: Global.Symbol, name: Global.Name, toName: Global.Name): Global.Import
Builds a fully attributed, synthetic import node.
Builds a fully attributed, synthetic import node. import
qualSym
.{name
=>toName
} -
def
mkIsInstanceOf(value: Global.Tree, tpe: Global.Type, any: Boolean, wrapInApply: Boolean): Global.Tree
- Definition Classes
- TreeGen
- def mkLiftedFunctionBodyMethod(localTyper: (analyzer)#Typer)(owner: Global.Symbol, fun: Global.Function): Global.DefDef
-
def
mkLiteralUnit: Global.Literal
- Definition Classes
- TreeGen
-
def
mkManifestFactoryCall(full: Boolean, constructor: String, tparg: Global.Type, args: List[Global.Tree]): Global.Tree
A creator for a call to a scala.reflect.Manifest or ClassManifest factory method.
A creator for a call to a scala.reflect.Manifest or ClassManifest factory method.
- full
full or partial manifest (target will be Manifest or ClassManifest)
- constructor
name of the factory method (e.g. "classType")
- tparg
the type argument
- args
value arguments
- returns
the tree
-
def
mkMethodCall(target: Global.Tree, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(receiver: Global.Tree, method: Global.Symbol, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(receiver: Global.Symbol, methodName: Global.Name, args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(target: Global.Tree, args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(method: Global.Symbol, args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(method: Global.Symbol, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkMethodCall(receiver: Global.Symbol, methodName: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
- def mkMethodFromFunction(localTyper: (analyzer)#Typer)(owner: Global.Symbol, fun: Global.Function): Global.DefDef
-
def
mkNamedArg(lhs: Global.Tree, rhs: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkNamedArg(name: Global.Name, tree: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkNew(parents: List[Global.Tree], self: Global.ValDef, stats: List[Global.Tree], npos: Global.Position, cpos: Global.Position): Global.Tree
- Definition Classes
- TreeGen
-
def
mkNil: Global.Tree
- Definition Classes
- TreeGen
-
def
mkNullaryCall(method: Global.Symbol, targs: List[Global.Type]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkOr(tree1: Global.Tree, tree2: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkPackageObject(defn: Global.ModuleDef, pidPos: Global.Position, pkgPos: Global.Position): Global.PackageDef
- Definition Classes
- TreeGen
-
def
mkParents(ownerMods: Global.Modifiers, parents: List[Global.Tree], parentPos: Global.Position): collection.immutable.List[Global.Tree]
- Definition Classes
- TreeGen
-
def
mkPatDef(mods: Global.Modifiers, pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]
- Definition Classes
- TreeGen
-
def
mkPatDef(pat: Global.Tree, rhs: Global.Tree)(implicit fresh: FreshNameCreator): List[Global.ValDef]
- Definition Classes
- TreeGen
- def mkRuntimeCall(meth: Global.Name, targs: List[Global.Type], args: List[Global.Tree]): Global.Tree
- def mkRuntimeCall(meth: Global.Name, args: List[Global.Tree]): Global.Tree
-
def
mkRuntimeUniverseRef: Global.Tree
- Definition Classes
- TreeGen
-
def
mkSeqApply(arg: Global.Tree): Global.Apply
- Definition Classes
- TreeGen
- def mkSoftRef(expr: Global.Tree): Global.Tree
-
final
def
mkStatic(orig: Global.DefDef, newName: Global.Name, maybeClone: (Global.Symbol) ⇒ Global.Symbol): Global.DefDef
Create a new
DefDef
based onorig
with an explicit self parameter.Create a new
DefDef
based onorig
with an explicit self parameter.Details:
- Must by run after erasure
- If
maybeClone
is the identity function, this runs "in place" and mutates the symbol oforig
.orig
should be discarded - Symbol owners and returns are substituted, as are parameter symbols
- Recursive calls are not rewritten. This is correct if we assume
that we either:
- are in "in-place" mode, but can guarantee that no recursive calls exists
- are associating the RHS with a cloned symbol, but intend for the original method to remain and for recursive calls to target it.
-
def
mkSuperInitCall: Global.Select
- Definition Classes
- TreeGen
-
def
mkSynchronized(monitor: Global.Tree, body: Global.Tree): Global.Tree
Make a synchronized block on 'monitor'.
- def mkSynchronizedCheck(attrThis: Global.Tree, cond: Global.Tree, syncBody: List[Global.Tree], stats: List[Global.Tree]): Global.Tree
-
def
mkSynchronizedCheck(clazz: Global.Symbol, cond: Global.Tree, syncBody: List[Global.Tree], stats: List[Global.Tree]): Global.Tree
Return the synchronized part of the double-checked locking idiom around the syncBody tree.
Return the synchronized part of the double-checked locking idiom around the syncBody tree. It guards with
cond
and synchronizes onclazz.this
. Additional statements can be included after initialization, (outside the synchronized block).The idiom works only if the condition is using a volatile field.
- See also
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
-
def
mkSyntheticParam(pname: Global.TermName): Global.ValDef
- Definition Classes
- TreeGen
-
def
mkSyntheticUnit(): Global.Literal
- Definition Classes
- TreeGen
- def mkSysErrorCall(message: String): Global.Tree
-
def
mkTemplate(parents: List[Global.Tree], self: Global.ValDef, constrMods: Global.Modifiers, vparamss: List[List[Global.ValDef]], body: List[Global.Tree], superPos: Global.Position): Global.Template
- Definition Classes
- TreeGen
-
def
mkTreeOrBlock(stats: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkTuple(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
mkTupleType(elems: List[Global.Tree], flattenUnary: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
mkTypeApply(fun: Global.Tree, targs: List[Global.Tree]): Global.Tree
- Definition Classes
- TreeGen
-
def
mkUnattributedRef(fullName: Global.Name): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkUnattributedRef(sym: Global.Symbol): Global.RefTree
- Definition Classes
- TreeGen
-
def
mkUnchecked(expr: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
mkUnitBlock(expr: Global.Tree): Global.Block
- Definition Classes
- TreeGen
-
def
mkVisitor(cases: List[Global.CaseDef], checkExhaustive: Boolean, prefix: String)(implicit fresh: FreshNameCreator): Global.Tree
- Definition Classes
- TreeGen
-
def
mkWildcardImport(pkg: Global.Symbol): Global.Import
Builds a fully attributed, synthetic wildcard import node.
-
def
mkWrapArray(tree: Global.Tree, elemtp: Global.Type): Global.Tree
Applies a wrapArray call to an array, making it a WrappedArray.
Applies a wrapArray call to an array, making it a WrappedArray. Don't let a reference type parameter be inferred, in case it's a singleton: apply the element type directly.
-
def
mkZero(tp: Global.Type): Global.Tree
- Definition Classes
- TreeGen
-
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
- def newModule(accessor: Global.Symbol, tpe: Global.Type): Global.Tree
-
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
-
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
- def paramToArg(arg: Global.Ident, isRepeatedParam: Boolean): Global.Tree
- def paramToArg(vparam: Global.ValDef): Global.Tree
- def paramToArg(vparam: Global.Symbol): Global.Tree
-
def
rootId(name: Global.Name): Global.Select
- Definition Classes
- TreeGen
-
def
rootScalaDot(name: Global.Name): Global.Select
- Definition Classes
- TreeGen
-
def
scalaAnnotationDot(name: Global.Name): Global.Select
- Definition Classes
- TreeGen
-
def
scalaAnyRefConstr: Global.Select
- Definition Classes
- TreeGen
-
def
scalaDot(name: Global.Name): Global.Select
- Definition Classes
- TreeGen
-
def
scalaFunctionConstr(argtpes: List[Global.Tree], restpe: Global.Tree, abstractFun: Boolean): Global.Tree
- Definition Classes
- TreeGen
-
def
stabilize(tree: Global.Tree): Global.Tree
- Definition Classes
- TreeGen
-
def
stableTypeFor(tree: Global.Tree): Global.Type
- Definition Classes
- TreeGen
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def wildcardStar(tree: Global.Tree): Global.Typed
- def →[B](y: B): (TreeGen, B)
-
object
Filter
- Definition Classes
- TreeGen
-
object
Yield
- Definition Classes
- TreeGen
-
object
patvarTransformer extends reflect.internal.SymbolTable.Transformer
- Definition Classes
- TreeGen
The Scala compiler API.
The following resources are useful for Scala plugin/compiler development: