public class JifToJavaRewriter
extends polyglot.visit.ContextVisitor
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<polyglot.ast.ClassDecl> |
additionalClassDecls |
protected java.util.List<polyglot.ast.Stmt> |
initializations |
protected polyglot.frontend.ExtensionInfo |
java_ext |
protected JifNodeFactory |
jif_nf |
protected JifTypeSystem |
jif_ts |
protected java.util.Collection<polyglot.ast.SourceFile> |
newSourceFiles |
protected polyglot.qq.QQ |
qq |
protected java.util.List<polyglot.ast.Block> |
staticInitializations |
Constructor and Description |
---|
JifToJavaRewriter(polyglot.frontend.Job job,
JifTypeSystem jif_ts,
JifNodeFactory jif_nf,
polyglot.frontend.ExtensionInfo java_ext) |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalClassDecl(polyglot.ast.ClassDecl cd) |
void |
addInitializer(polyglot.ast.Block s) |
void |
addInitializer(polyglot.types.FieldInstance fi,
polyglot.ast.Expr init) |
void |
addStaticInitializer(polyglot.ast.Block s) |
protected polyglot.ast.TypeNode |
canonical(polyglot.ast.NodeFactory nf,
polyglot.types.Type t,
polyglot.util.Position pos) |
JifToJavaRewriter |
copy() |
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<polyglot.ast.Stmt> |
getInitializations() |
java.util.List<polyglot.ast.Block> |
getStaticInitializations() |
java.lang.Boolean |
haveThisCall() |
void |
haveThisCall(boolean value) |
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.Expr |
labelToJava(Label label,
boolean simplify) |
polyglot.ast.Expr |
labelToJava(Label label,
polyglot.ast.Expr thisQualifier) |
polyglot.ast.Expr |
labelToJava(Label label,
polyglot.ast.Expr thisQualifier,
boolean simplify) |
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 |
paramToJava(Param param,
polyglot.ast.Expr thisQualifier) |
polyglot.ast.Expr |
principalToJava(Principal principal) |
polyglot.ast.Expr |
principalToJava(Principal principal,
polyglot.ast.Expr thisQualifier) |
polyglot.qq.QQ |
qq() |
java.lang.String |
runtimeLabelUtil()
The full class path of the runtime label utility.
|
polyglot.ast.TypeNode |
typeToJava(polyglot.types.Type t,
polyglot.util.Position pos) |
addDecls, addDecls, begin, context, context, enter, enter, enterScope, leave, rethrowMissingDependencies, superEnter
catchErrors, enterCall, enterError, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem
bypass, bypass, bypassChildren, override, visitChildren
protected polyglot.frontend.ExtensionInfo java_ext
protected JifTypeSystem jif_ts
protected JifNodeFactory jif_nf
protected polyglot.qq.QQ qq
protected java.util.Collection<polyglot.ast.ClassDecl> additionalClassDecls
protected java.util.Collection<polyglot.ast.SourceFile> newSourceFiles
protected java.util.List<polyglot.ast.Stmt> initializations
protected java.util.List<polyglot.ast.Block> staticInitializations
public JifToJavaRewriter(polyglot.frontend.Job job, JifTypeSystem jif_ts, JifNodeFactory jif_nf, polyglot.frontend.ExtensionInfo java_ext)
public JifToJavaRewriter copy()
copy
in interface polyglot.util.Copy<polyglot.visit.NodeVisitor>
copy
in class polyglot.visit.NodeVisitor
public void finish(polyglot.ast.Node ast)
finish
in class polyglot.visit.NodeVisitor
public JifTypeSystem jif_ts()
public JifNodeFactory jif_nf()
public polyglot.types.TypeSystem java_ts()
public polyglot.ast.NodeFactory java_nf()
public polyglot.util.ErrorQueue errorQueue()
errorQueue
in class polyglot.visit.ErrorHandlingVisitor
public polyglot.visit.NodeVisitor enterCall(polyglot.ast.Node n)
enterCall
in class polyglot.visit.ErrorHandlingVisitor
public polyglot.ast.Node leaveCall(polyglot.ast.Node old, polyglot.ast.Node n, polyglot.visit.NodeVisitor v)
leaveCall
in class polyglot.visit.ErrorHandlingVisitor
public polyglot.ast.Expr paramToJava(Param param) throws polyglot.types.SemanticException
polyglot.types.SemanticException
public polyglot.ast.Expr paramToJava(Param param, polyglot.ast.Expr thisQualifier) throws polyglot.types.SemanticException
thisQualifier
- an Expr representing the translated "this" reference.polyglot.types.SemanticException
public polyglot.ast.Expr labelToJava(Label label) throws polyglot.types.SemanticException
polyglot.types.SemanticException
public polyglot.ast.Expr labelToJava(Label label, boolean simplify) throws polyglot.types.SemanticException
simplify
- whether to attempt to simplify the label when it's constructed
at run time.polyglot.types.SemanticException
public polyglot.ast.Expr labelToJava(Label label, polyglot.ast.Expr thisQualifier) throws polyglot.types.SemanticException
thisQualifier
- an Expr representing the translated "this" reference.polyglot.types.SemanticException
public polyglot.ast.Expr labelToJava(Label label, polyglot.ast.Expr thisQualifier, boolean simplify) throws polyglot.types.SemanticException
thisQualifier
- an Expr representing the translated "this" reference.simplify
- whether to attempt to simplify the label when it's constructed
at run time.polyglot.types.SemanticException
public polyglot.ast.Expr principalToJava(Principal principal) throws polyglot.types.SemanticException
polyglot.types.SemanticException
public polyglot.ast.Expr principalToJava(Principal principal, polyglot.ast.Expr thisQualifier) throws polyglot.types.SemanticException
thisQualifier
- an Expr representing the translated "this" reference.polyglot.types.SemanticException
public polyglot.ast.TypeNode typeToJava(polyglot.types.Type t, polyglot.util.Position pos) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected polyglot.ast.TypeNode canonical(polyglot.ast.NodeFactory nf, polyglot.types.Type t, polyglot.util.Position pos)
public polyglot.qq.QQ qq()
public polyglot.types.ClassType currentClass()
public void enteringClass(polyglot.types.ClassType t)
public void leavingClass()
public void addInitializer(polyglot.ast.Block s)
public void addInitializer(polyglot.types.FieldInstance fi, polyglot.ast.Expr init) throws polyglot.types.SemanticException
polyglot.types.SemanticException
public java.util.List<polyglot.ast.Stmt> getInitializations()
public void addStaticInitializer(polyglot.ast.Block s)
public java.util.List<polyglot.ast.Block> getStaticInitializations()
public void addAdditionalClassDecl(polyglot.ast.ClassDecl cd)
public polyglot.ast.Node leavingSourceFile(polyglot.ast.SourceFile n)
public boolean inConstructor()
public void inConstructor(boolean flag)
public java.lang.Boolean haveThisCall()
public void haveThisCall(boolean value)
public java.lang.String runtimeLabelUtil()