jif.translate

## Class ClassDeclToJavaExt_c

- java.lang.Object
- - polyglot.ast.Ext_c
  - - jif.translate.ToJavaExt_c
    - - jif.translate.ClassDeclToJavaExt_c

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ToJavaExt, polyglot.ast.Ext, polyglot.ast.NodeOps, polyglot.util.Copy<polyglot.ast.Ext>

      public class ClassDeclToJavaExt_c
      extends ToJavaExt_c

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    Fields
    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`

    - ### Fields inherited from class polyglot.ast.Ext_c

      `ext, node, pred`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassDeclToJavaExt_c()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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)`

    - ### Methods inherited from class jif.translate.ToJavaExt_c

      `toJava`

    - ### Methods inherited from class polyglot.ast.Ext_c

      `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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface polyglot.ast.Ext

      `dump, ext, ext, init, initPred, node, pred`

    - ### Methods inherited from interface polyglot.ast.NodeOps

      `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`

    - ### Methods inherited from interface polyglot.util.Copy

      `copy`

- - ### Field Detail

    - #### INSTANCEOF_METHOD_NAME

          public static final java.lang.String INSTANCEOF_METHOD_NAME

      See Also:
        Constant Field Values

    - #### INITIALIZATIONS_METHOD_NAME

          protected static final java.lang.String INITIALIZATIONS_METHOD_NAME

      See Also:
        Constant Field Values

    - #### DEFAULT_CONSTRUCTOR_INVOKER_METHOD_NAME

          protected static final java.lang.String DEFAULT_CONSTRUCTOR_INVOKER_METHOD_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClassDeclToJavaExt_c

          public ClassDeclToJavaExt_c()

  - ### Method Detail

    - #### castMethodName

          public static final java.lang.String castMethodName(polyglot.types.ClassType ct)

    - #### interfaceClassImplName

          public static final java.lang.String interfaceClassImplName(java.lang.String jifInterfaceName)

    - #### constructorTranslatedName

          public static final java.lang.String constructorTranslatedName(polyglot.types.ClassType ct)

    - #### toJavaEnter

          public polyglot.visit.NodeVisitor toJavaEnter(JifToJavaRewriter rw)
                                                 throws polyglot.types.SemanticException

      Specified by:
        `toJavaEnter` in interface `ToJavaExt`
      Overrides:
        `toJavaEnter` in class `ToJavaExt_c`
      Throws:
        `polyglot.types.SemanticException`

    - #### toJava

          public polyglot.ast.Node toJava(JifToJavaRewriter rw)
                                   throws polyglot.types.SemanticException

      Specified by:
        `toJava` in class `ToJavaExt_c`
      Throws:
        `polyglot.types.SemanticException`

    - #### toJavaImpl

          protected polyglot.ast.Node toJavaImpl(JifToJavaRewriter rw)
                                          throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### addInitializer

          protected polyglot.ast.ClassBody addInitializer(polyglot.ast.ClassBody cb,
                                                          JifToJavaRewriter rw)

      Create a method for initializations, and add it to cb.

    - #### addStaticInitializers

          protected polyglot.ast.ClassBody addStaticInitializers(polyglot.ast.ClassBody cb,
                                                                 JifToJavaRewriter rw)

      Create methods for static initializations, and add it to cb.

    - #### addInterfaceParamGetters

          protected polyglot.ast.ClassBody addInterfaceParamGetters(polyglot.ast.ClassBody cb,
                                                                    JifPolyType baseClass,
                                                                    JifPolyType jpt,
                                                                    JifToJavaRewriter rw)
                                                             throws polyglot.types.SemanticException

      Go through the interfaces, and add any required fields and getters for the fields.
      Parameters:
        `cb` -
        `jpt` -
        `rw` -
      Throws:
        `polyglot.types.SemanticException`

    - #### produceInstanceOfMethod

          protected polyglot.ast.ClassMember produceInstanceOfMethod(JifPolyType jpt,
                                                                     JifToJavaRewriter rw,
                                                                     boolean useGetters)
                                                              throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### produceCastMethod

          protected polyglot.ast.ClassMember produceCastMethod(JifPolyType jpt,
                                                               JifToJavaRewriter rw)
                                                        throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### produceFormals

          protected java.util.List<polyglot.ast.Formal> produceFormals(JifPolyType jpt,
                                                                       JifToJavaRewriter rw)
                                                                throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### produceObjectFormal

          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

    - #### produceParamFormals

          protected static java.util.List<polyglot.ast.Formal> produceParamFormals(JifPolyType jpt,
                                                                                   JifToJavaRewriter rw)
                                                                            throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### produceParamArgs

          protected java.util.List<polyglot.ast.Expr> produceParamArgs(JifPolyType jpt,
                                                                       JifToJavaRewriter rw)

    - #### produceConstructor

          protected polyglot.ast.ClassMember produceConstructor(JifPolyType jpt,
                                                                JifToJavaRewriter rw)
                                                         throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### additionalConstructorCode

          protected java.util.List<polyglot.ast.Stmt> additionalConstructorCode(JifToJavaRewriter rw)

    - #### produceDefaultConstructorInvoker

          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. This method assumes that such a default constructor exists.