|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.visit.NodeVisitor
polyglot.visit.HaltingVisitor
polyglot.visit.ErrorHandlingVisitor
polyglot.visit.ContextVisitor
polyglot.visit.AscriptionVisitor
polyglot.ext.op.OPCastRewriter
Field Summary |
Fields inherited from class polyglot.visit.ContextVisitor |
context |
Fields inherited from class polyglot.visit.ErrorHandlingVisitor |
error, job, nf, ts |
Constructor Summary | |
OPCastRewriter(Job job,
TypeSystem ts,
NodeFactory nf)
|
Method Summary | |
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. |
Node |
leaveCall(Node old,
Node n,
NodeVisitor v)
Calls ascribe() |
Methods inherited from class polyglot.visit.AscriptionVisitor |
enterCall, pop, toType |
Methods inherited from class polyglot.visit.ContextVisitor |
addDecls, begin, context, context, enter, enterScope, leave, superEnter |
Methods inherited from class polyglot.visit.ErrorHandlingVisitor |
catchErrors, enterCall, enterError, errorQueue, job, leaveCall, nodeFactory, typeSystem |
Methods inherited from class polyglot.visit.HaltingVisitor |
bypass, bypass, bypassChildren, copy, override, visitChildren |
Methods inherited from class polyglot.visit.NodeVisitor |
enter, finish, finish, leave, override, toString, visitEdge |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OPCastRewriter(Job job, TypeSystem ts, NodeFactory nf)
Method Detail |
public Expr ascribe(Expr e, Type toType)
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.
public Node leaveCall(Node old, Node n, NodeVisitor v) throws SemanticException
AscriptionVisitor
ascribe() with the expected type and expression
as appropriate. Otherwise functionally the same as the
leaveCall
method in ErrorHandlingVisitor
.
- Overrides:
leaveCall
in class AscriptionVisitor
- Throws:
SemanticException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |