gov.llnl.babel.backend.fortran

Class ModuleSource


public class ModuleSource
extends java.lang.Object

This class provides the ability to write a FORTRAN 90 module for a sidl class/interface.

Constructor Summary

ModuleSource(LanguageWriterForFortran writer, Context context)
Generate an instance to write the module for a FORTRAN 90 client.

Method Summary

static Set
extendedReferences(Extendable ext, Context context)
void
generateCode(Enumeration enm)
Generate the FORTRAN 90 module file for a sidl enumerated type.
void
generateCode(Extendable ext)
Generate the FORTRAN 90 module file for a sidl class.
static void
generateCode(Symbol sym, LanguageWriterForFortran writer, Context context)
Generate the FORTRAN 90 module file for a sidl class.
void
generateSupers(Class cls, CodeSplicer splicer, NameMangler mang)
static void
generateSupers(Class cls, LanguageWriterForFortran writer, CodeSplicer splicer, Context context, NameMangler mang)
This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files.

Constructor Details

ModuleSource

public ModuleSource(LanguageWriterForFortran writer,
                    Context context)
Generate an instance to write the module for a FORTRAN 90 client.
Parameters:
writer - the output device to which the FORTRAN 90 module should be written.

Method Details

extendedReferences

public static Set extendedReferences(Extendable ext,
                                     Context context)
            throws CodeGenerationException

generateCode

public void generateCode(Enumeration enm)
            throws CodeGenerationException
Generate the FORTRAN 90 module file for a sidl enumerated type.
Parameters:
enm - the sidl enumeration whose module is to be written.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

generateCode

public void generateCode(Extendable ext)
            throws CodeGenerationException
Generate the FORTRAN 90 module file for a sidl class.
Parameters:
ext - the sidl class whose module is to be written.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

generateCode

public static void generateCode(Symbol sym,
                                LanguageWriterForFortran writer,
                                Context context)
            throws CodeGenerationException
Generate the FORTRAN 90 module file for a sidl class. Note: This is the assumed entry point; otherwise, the test for the version of the language should be repeated.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

generateSupers

public void generateSupers(Class cls,
                           CodeSplicer splicer,
                           NameMangler mang)
            throws CodeGenerationException

generateSupers

public static void generateSupers(Class cls,
                                  LanguageWriterForFortran writer,
                                  CodeSplicer splicer,
                                  Context context,
                                  NameMangler mang)
            throws CodeGenerationException
This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files. The output stream is not closed on exit. A code generation exception is thrown if an error is detected.
Parameters:
cls - The class in which these supers are to be generated
writer - the output writer to which the stub source will be written. This will not be closed.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.