jif.translate
Class JifToJavaRewriter
java.lang.Object
polyglot.visit.NodeVisitor
polyglot.visit.HaltingVisitor
polyglot.visit.ErrorHandlingVisitor
polyglot.visit.ContextVisitor
jif.translate.JifToJavaRewriter
- All Implemented Interfaces:
- java.lang.Cloneable, polyglot.util.Copy
public class JifToJavaRewriter
- extends polyglot.visit.ContextVisitor
Visitor which performs rewriting on the AST.
Fields inherited from class polyglot.visit.ContextVisitor |
context, outer, prune, rethrowMissingDependencies |
Fields inherited from class polyglot.visit.ErrorHandlingVisitor |
error, nf, ts |
Fields inherited from class polyglot.visit.HaltingVisitor |
bypass, bypassParent |
Methods inherited from class polyglot.visit.ContextVisitor |
addDecls, begin, context, context, enter, enter, enterScope, leave, rethrowMissingDependencies, superEnter |
Methods inherited from class polyglot.visit.ErrorHandlingVisitor |
catchErrors, enterCall, enterError, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem |
Methods inherited from class polyglot.visit.HaltingVisitor |
bypass, bypass, bypassChildren, override, visitChildren |
Methods inherited from class polyglot.visit.NodeVisitor |
copy, finish, leave, override, toString, visitEdge, visitEdgeNoOverride |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
additionalClassDecls
protected java.util.Collection additionalClassDecls
newSourceFiles
protected java.util.Collection newSourceFiles
initializations
protected java.util.List initializations
staticInitializations
protected java.util.List staticInitializations
JifToJavaRewriter
public JifToJavaRewriter(polyglot.frontend.Job job,
JifTypeSystem jif_ts,
JifNodeFactory jif_nf,
polyglot.frontend.ExtensionInfo java_ext)
finish
public void finish(polyglot.ast.Node ast)
- Overrides:
finish
in class polyglot.visit.NodeVisitor
jif_ts
public JifTypeSystem jif_ts()
jif_nf
public JifNodeFactory jif_nf()
java_ts
public polyglot.types.TypeSystem java_ts()
java_nf
public polyglot.ast.NodeFactory java_nf()
errorQueue
public polyglot.util.ErrorQueue errorQueue()
- Overrides:
errorQueue
in class polyglot.visit.ErrorHandlingVisitor
enterCall
public polyglot.visit.NodeVisitor enterCall(polyglot.ast.Node n)
- Overrides:
enterCall
in class polyglot.visit.ErrorHandlingVisitor
leaveCall
public polyglot.ast.Node leaveCall(polyglot.ast.Node old,
polyglot.ast.Node n,
polyglot.visit.NodeVisitor v)
- Overrides:
leaveCall
in class polyglot.visit.ErrorHandlingVisitor
paramToJava
public polyglot.ast.Expr paramToJava(Param param)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
labelToJava
public polyglot.ast.Expr labelToJava(Label label)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
principalToJava
public polyglot.ast.Expr principalToJava(Principal principal)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
typeToJava
public polyglot.ast.TypeNode typeToJava(polyglot.types.Type t,
polyglot.util.Position pos)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
canonical
protected polyglot.ast.TypeNode canonical(polyglot.ast.NodeFactory nf,
polyglot.types.Type t,
polyglot.util.Position pos)
qq
public polyglot.qq.QQ qq()
currentClass
public polyglot.types.ClassType currentClass()
enteringClass
public void enteringClass(polyglot.types.ClassType t)
leavingClass
public void leavingClass()
addInitializer
public void addInitializer(polyglot.ast.Block s)
addInitializer
public void addInitializer(polyglot.types.FieldInstance fi,
polyglot.ast.Expr init)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
getInitializations
public java.util.List getInitializations()
addStaticInitializer
public void addStaticInitializer(polyglot.ast.Block s)
getStaticInitializations
public java.util.List getStaticInitializations()
addAdditionalClassDecl
public void addAdditionalClassDecl(polyglot.ast.ClassDecl cd)
leavingSourceFile
public polyglot.ast.Node leavingSourceFile(polyglot.ast.SourceFile n)
- Take any additional class declarations that can fit into the source file,
i.e., non-public class decls.
inConstructor
public boolean inConstructor()
inConstructor
public void inConstructor(boolean flag)
runtimeLabelUtil
public java.lang.String runtimeLabelUtil()
- The full class path of the runtime label utility.