public class AutoBoxer extends AscriptionVisitor
outer, type
context, prune, rethrowMissingDependencies
error, job, nf, ts
bypass, bypassParent
Constructor and Description |
---|
AutoBoxer(Job job,
JL5TypeSystem ts,
NodeFactory nf) |
Modifier and Type | Method and Description |
---|---|
Expr |
ascribe(Expr e,
Type toType)
The
ascribe() method is called for each expression
and is passed the type the expression is used at rather
than the type the type
checker assigns to it. |
enterCall, lang, leaveCall, pop, toType
addDecls, addDecls, begin, context, context, enter, enter, enterScope, leave, rethrowMissingDependencies, superEnter
catchErrors, enterCall, enterError, errorQueue, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem
bypass, bypass, bypassChildren, override, visitChildren
copy, finish, finish, leave, override, toString, visitEdge, visitEdgeNoOverride
public AutoBoxer(Job job, JL5TypeSystem ts, NodeFactory nf)
public Expr ascribe(Expr e, Type toType) throws SemanticException
AscriptionVisitor
ascribe()
method is called for each expression
and is passed the type the expression is used at rather
than the type the type
checker assigns to it.
For instance, with the following code:
Object o = new Integer(3);
ascribe()
will be called with expression
new Integer(3)
and type Object
.ascribe
in class AscriptionVisitor
e
- The expression that is being visitedtoType
- The type that the parent node is expecting.SemanticException