polyglot.visit
Class LocalClassRemover
java.lang.Object
polyglot.visit.NodeVisitor
polyglot.visit.HaltingVisitor
polyglot.visit.ErrorHandlingVisitor
polyglot.visit.ContextVisitor
polyglot.visit.LocalClassRemover
- All Implemented Interfaces:
- java.lang.Cloneable, Copy
public class LocalClassRemover
- extends ContextVisitor
- Author:
- nystrom
This class translates local classes and anonymous classes to member classes.
It adds fields to the classes for each local variable in the enclosing method
that is used in the class body.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LocalClassRemover
public LocalClassRemover(Job job,
TypeSystem ts,
NodeFactory nf)
newFieldName
protected java.lang.String newFieldName(java.lang.String name)
namePrefix
protected java.lang.String namePrefix()
isLocal
protected boolean isLocal(ClassType ct)
leaveCall
protected Node leaveCall(Node old,
Node n,
NodeVisitor v)
throws SemanticException
- Overrides:
leaveCall
in class ErrorHandlingVisitor
- Throws:
SemanticException
enterCall
protected NodeVisitor enterCall(Node n)
throws SemanticException
- Overrides:
enterCall
in class ErrorHandlingVisitor
- Throws:
SemanticException
translateLocalClassBody
protected void translateLocalClassBody(ParsedClassType ct,
ClassBody body,
Context context)