gov.llnl.babel.backend.fortran

Class SkelSource


public class SkelSource
extends java.lang.Object

The purpose of this class is to generate the C skeleton code to support sidl objects implemented in FORTRAN. The skeleton code makes the link between the independent object representation (IOR) and the FORTRAN implementation of a sidl class. The skeleton must map datatypes in C to datatypes in FORTRAN. It must must also provide C functions to populate the static and object entry point vectors for the IOR.

Constructor Summary

SkelSource(LanguageWriterForC writer, Context context)
Create an object to generate the skeleton code in C for a FORTRAN object.

Method Summary

void
doOutArg(Type argType, String argName, int mode)
For out and inout parameters, convert the values from the proxy variables into something that the IOR can handle.
void
generateCode(Class cls)
This method creates a skeleton file for a class.
static void
generateCode(Class cls, LanguageWriterForC writer, Context context)
This is a convenience routine to create a skeleton file for a class without having to make an instance of SkelSource.

Constructor Details

SkelSource

public SkelSource(LanguageWriterForC writer,
                  Context context)
            throws NoSuchAlgorithmException
Create an object to generate the skeleton code in C for a FORTRAN object.
Parameters:
writer - the skeleton code is written to this device.

Method Details

doOutArg

public void doOutArg(Type argType,
                     String argName,
                     int mode)
            throws CodeGenerationException
For out and inout parameters, convert the values from the proxy variables into something that the IOR can handle.
Parameters:
argType - the type of the argument.
argName - the original name of the formal argument.
mode - the mode of the argument.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

generateCode

public void generateCode(Class cls)
            throws CodeGenerationException
This method creates a skeleton file for a class. The skeleton file is a C module that is the glue between the IOR and the implementation of a class written in FORTRAN.
Parameters:
cls - the class to create.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

generateCode

public static void generateCode(Class cls,
                                LanguageWriterForC writer,
                                Context context)
            throws CodeGenerationException,
                   NoSuchAlgorithmException
This is a convenience routine to create a skeleton file for a class without having to make an instance of SkelSource. The skeleton file is a C module that is the glue between the IOR and the implementation of a class written in FORTRAN.
Parameters:
cls - the class for whom a skeleton will be made.
writer - the output device where the skeleton file will be sent.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.