public class ClassDeclToJavaExt_c extends ToJavaExt_c
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_CONSTRUCTOR_INVOKER_METHOD_NAME |
protected static java.lang.String |
INITIALIZATIONS_METHOD_NAME |
static java.lang.String |
INSTANCEOF_METHOD_NAME |
Constructor and Description |
---|
ClassDeclToJavaExt_c() |
Modifier and Type | Method and Description |
---|---|
protected polyglot.ast.ClassBody |
addInitializer(polyglot.ast.ClassBody cb,
JifToJavaRewriter rw)
Create a method for initializations, and add it to cb.
|
protected polyglot.ast.ClassBody |
addInterfaceParamGetters(polyglot.ast.ClassBody cb,
JifPolyType baseClass,
JifPolyType jpt,
JifToJavaRewriter rw)
Go through the interfaces, and add any required fields and getters for the fields.
|
protected java.util.List<polyglot.ast.Stmt> |
additionalConstructorCode(JifToJavaRewriter rw) |
protected polyglot.ast.ClassBody |
addStaticInitializers(polyglot.ast.ClassBody cb,
JifToJavaRewriter rw)
Create methods for static initializations, and add it to cb.
|
static java.lang.String |
castMethodName(polyglot.types.ClassType ct) |
static java.lang.String |
constructorTranslatedName(polyglot.types.ClassType ct) |
static java.lang.String |
interfaceClassImplName(java.lang.String jifInterfaceName) |
protected polyglot.ast.ClassMember |
produceCastMethod(JifPolyType jpt,
JifToJavaRewriter rw) |
protected polyglot.ast.ClassMember |
produceConstructor(JifPolyType jpt,
JifToJavaRewriter rw) |
protected polyglot.ast.ClassMember |
produceDefaultConstructorInvoker(polyglot.types.ClassType ct,
JifToJavaRewriter rw,
java.util.List<? extends polyglot.types.Type> throwTypes)
Produce a method (with a standard name) that will invoke the default
constructor of the class.
|
protected java.util.List<polyglot.ast.Formal> |
produceFormals(JifPolyType jpt,
JifToJavaRewriter rw) |
protected polyglot.ast.ClassMember |
produceInstanceOfMethod(JifPolyType jpt,
JifToJavaRewriter rw,
boolean useGetters) |
protected polyglot.ast.Formal |
produceObjectFormal(JifPolyType jpt,
JifToJavaRewriter rw)
Returns the formal with id "o" for the object passed to the cast and instanceof methods
|
protected java.util.List<polyglot.ast.Expr> |
produceParamArgs(JifPolyType jpt,
JifToJavaRewriter rw) |
protected static java.util.List<polyglot.ast.Formal> |
produceParamFormals(JifPolyType jpt,
JifToJavaRewriter rw) |
polyglot.ast.Node |
toJava(JifToJavaRewriter rw) |
polyglot.visit.NodeVisitor |
toJavaEnter(JifToJavaRewriter rw) |
protected polyglot.ast.Node |
toJavaImpl(JifToJavaRewriter rw) |
toJava
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, extRewriteOverride, init, initPred, lang, node, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, extRewriteOverride, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
public static final java.lang.String INSTANCEOF_METHOD_NAME
protected static final java.lang.String INITIALIZATIONS_METHOD_NAME
protected static final java.lang.String DEFAULT_CONSTRUCTOR_INVOKER_METHOD_NAME
public static final java.lang.String castMethodName(polyglot.types.ClassType ct)
public static final java.lang.String interfaceClassImplName(java.lang.String jifInterfaceName)
public static final java.lang.String constructorTranslatedName(polyglot.types.ClassType ct)
public polyglot.visit.NodeVisitor toJavaEnter(JifToJavaRewriter rw) throws polyglot.types.SemanticException
toJavaEnter
in interface ToJavaExt
toJavaEnter
in class ToJavaExt_c
polyglot.types.SemanticException
public polyglot.ast.Node toJava(JifToJavaRewriter rw) throws polyglot.types.SemanticException
toJava
in class ToJavaExt_c
polyglot.types.SemanticException
protected polyglot.ast.Node toJavaImpl(JifToJavaRewriter rw) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected polyglot.ast.ClassBody addInitializer(polyglot.ast.ClassBody cb, JifToJavaRewriter rw)
protected polyglot.ast.ClassBody addStaticInitializers(polyglot.ast.ClassBody cb, JifToJavaRewriter rw)
protected polyglot.ast.ClassBody addInterfaceParamGetters(polyglot.ast.ClassBody cb, JifPolyType baseClass, JifPolyType jpt, JifToJavaRewriter rw) throws polyglot.types.SemanticException
cb
- jpt
- rw
- polyglot.types.SemanticException
protected polyglot.ast.ClassMember produceInstanceOfMethod(JifPolyType jpt, JifToJavaRewriter rw, boolean useGetters) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected polyglot.ast.ClassMember produceCastMethod(JifPolyType jpt, JifToJavaRewriter rw) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected java.util.List<polyglot.ast.Formal> produceFormals(JifPolyType jpt, JifToJavaRewriter rw) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected polyglot.ast.Formal produceObjectFormal(JifPolyType jpt, JifToJavaRewriter rw)
protected static java.util.List<polyglot.ast.Formal> produceParamFormals(JifPolyType jpt, JifToJavaRewriter rw) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected java.util.List<polyglot.ast.Expr> produceParamArgs(JifPolyType jpt, JifToJavaRewriter rw)
protected polyglot.ast.ClassMember produceConstructor(JifPolyType jpt, JifToJavaRewriter rw) throws polyglot.types.SemanticException
polyglot.types.SemanticException
protected java.util.List<polyglot.ast.Stmt> additionalConstructorCode(JifToJavaRewriter rw)
protected polyglot.ast.ClassMember produceDefaultConstructorInvoker(polyglot.types.ClassType ct, JifToJavaRewriter rw, java.util.List<? extends polyglot.types.Type> throwTypes)