jif.translate
Class JifToJavaRewriter

java.lang.Object
  extended by polyglot.visit.NodeVisitor
      extended by polyglot.visit.HaltingVisitor
          extended by polyglot.visit.ErrorHandlingVisitor
              extended by polyglot.visit.ContextVisitor
                  extended by 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.


Field Summary
 
Fields inherited from class polyglot.visit.ContextVisitor
context, outer
 
Fields inherited from class polyglot.visit.ErrorHandlingVisitor
error, nf, ts
 
Constructor Summary
JifToJavaRewriter(polyglot.frontend.Job job, JifTypeSystem jif_ts, JifNodeFactory jif_nf, polyglot.frontend.ExtensionInfo java_ext)
           
 
Method Summary
 void addAdditionalClassDecl(polyglot.ast.ClassDecl cd)
           
 void addInitializer(polyglot.ast.Stmt s)
           
 polyglot.types.ClassType currentClass()
           
 polyglot.visit.NodeVisitor enterCall(polyglot.ast.Node n)
           
 void enteringClass(polyglot.types.ClassType t)
           
 polyglot.util.ErrorQueue errorQueue()
           
 void finish(polyglot.ast.Node ast)
           
 java.util.List getInitializations()
           
 boolean inConstructor()
           
 void inConstructor(boolean flag)
           
 polyglot.ast.NodeFactory java_nf()
           
 polyglot.types.TypeSystem java_ts()
           
 JifNodeFactory jif_nf()
           
 JifTypeSystem jif_ts()
           
 polyglot.ast.Expr labelToJava(Label label)
           
 polyglot.ast.Node leaveCall(polyglot.ast.Node old, polyglot.ast.Node n, polyglot.visit.NodeVisitor v)
           
 void leavingClass()
           
 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.
 polyglot.ast.Expr paramToJava(Param param)
           
 polyglot.ast.Expr principalToJava(Principal principal)
           
 polyglot.ext.jl.qq.QQ qq()
           
 
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, 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, enter, finish, leave, override, toString, visitEdge, visitEdgeNoOverride
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JifToJavaRewriter

public JifToJavaRewriter(polyglot.frontend.Job job,
                         JifTypeSystem jif_ts,
                         JifNodeFactory jif_nf,
                         polyglot.frontend.ExtensionInfo java_ext)
Method Detail

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

qq

public polyglot.ext.jl.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.Stmt s)

getInitializations

public java.util.List getInitializations()

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)