gov.llnl.babel.backend.c
Class C

java.lang.Object
  extended bygov.llnl.babel.backend.c.C

public class C
extends java.lang.Object

Class C contains common C language binding routines shared by the C backend code generators. This class simply collects many common C binding routines into one place.


Constructor Summary
C()
           
 
Method Summary
static java.lang.String getArgumentString(Argument arg)
          Generate a C argument string for the specified sidl argument.
static java.lang.String getArgumentWithFormal(Argument arg)
          Generate a C argument string with the formal argument name.
static java.lang.String getDataGetName(SymbolID id)
          Convert a symbol name into its private data structure get access function name.
static java.lang.String getDataName(SymbolID id)
          Convert a symbol name into its private data structure identifier.
static java.lang.String getDataSetName(SymbolID id)
          Convert a symbol name into its private data structure set access function name.
static java.lang.String getDelRefArray(Type arrayType)
           
static java.lang.String getEnsureArray(Type arrayType)
           
static java.lang.String getEnumName(SymbolID id)
          Convert a sidl enumerated type into its symbol name, which is "enum " followed by the symbol name followed by "__enum".
static java.lang.String getExceptionType()
           
static java.lang.String getFullMethodName(SymbolID id, Method method)
          Generate the full method name associated with the symbol id and the specified method.
static java.lang.String getFullMethodName(SymbolID id, java.lang.String methodName)
          Generate the full method name associated with the symbol id and the specified method.
static java.lang.String getHeaderFile(SymbolID id)
          Generate the header filename associated with a symbol identifier.
static java.lang.String getImplHeaderFile(SymbolID id)
          Generate the implementation header filename associated with a symbol identifier.
static java.lang.String getImplSourceFile(SymbolID id)
          Generate the implementation source filename associated with a symbol identifier.
static java.lang.String getMethodImplName(SymbolID id, java.lang.String methodName)
          Generate the impl method's name.
static java.lang.String getMethodSkelName(SymbolID id, Method method)
          Generate the skel method's name.
static java.lang.String getObjectName(SymbolID id)
          Convert a sidl symbol name into its object name -- for the purposes of this package that means convert it into its typedef object name.
static java.lang.String getPrivateDestructor(SymbolID id)
          Convert a symbol name into its private destructor function name provided by the SkelSource.
static java.lang.String getReturnString(Type type)
          Generate a C return string for the specified sidl type.
static java.lang.String getSetEPVName(SymbolID id)
          Convert a sidl symbol into the name of its associated set EPV method, which is the symbol name appended with "__set_epv".
static java.lang.String getSetSEPVName(SymbolID id)
          Convert a sidl symbol into the name of its associated set static EPV method, which is the symbol name appended with "__set_sepv".
static java.lang.String getSkelFile(SymbolID id)
          Generate the skeleton filename associated with a symbol identifier.
static java.lang.String getStubFile(SymbolID id)
          Generate the stub filename associated with a symbol identifier.
static java.lang.String getSymbolName(SymbolID id)
          Convert a symbol name into an IOR identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C

public C()
Method Detail

getHeaderFile

public static java.lang.String getHeaderFile(SymbolID id)
Generate the header filename associated with a symbol identifier. Replace the "." scope separators in the symbol by underscores and append the suffix ".h".

Parameters:
id - the SymbolID of the Symbol.

getStubFile

public static java.lang.String getStubFile(SymbolID id)
Generate the stub filename associated with a symbol identifier. Replace the "." scope separators in the symbol by underscores and append the suffix "_Stub.c".

Parameters:
id - the SymbolID of the Symbol.

getSkelFile

public static java.lang.String getSkelFile(SymbolID id)
Generate the skeleton filename associated with a symbol identifier. Replace the "." scope separators in the symbol by underscores and append the suffix "_Skel.c".

Parameters:
id - the SymbolID of the Symbol.

getImplHeaderFile

public static java.lang.String getImplHeaderFile(SymbolID id)
Generate the implementation header filename associated with a symbol identifier. Replace the "." scope separators in the symbol by underscores and append the suffix "_Impl.h".

Parameters:
id - the SymbolID of the Symbol.

getImplSourceFile

public static java.lang.String getImplSourceFile(SymbolID id)
Generate the implementation source filename associated with a symbol identifier. Replace the "." scope separators in the symbol by underscores and append the suffix "_Impl.c".

Parameters:
id - the SymbolID of the Symbol.

getDataName

public static java.lang.String getDataName(SymbolID id)
Convert a symbol name into its private data structure identifier. Unlike the IOR, though, use the typedef version (i.e., no "struct") where the sidl name with the "." scope separators replaced by underscores is followed by "__data".

Parameters:
id - the SymbolID of the Symbol.

getDataGetName

public static java.lang.String getDataGetName(SymbolID id)
Convert a symbol name into its private data structure get access function name. The function name is the sidl name with the "." scope separators replaced by underscores followed by "__get_data".

Parameters:
id - the SymbolID of the Symbol.

getDataSetName

public static java.lang.String getDataSetName(SymbolID id)
Convert a symbol name into its private data structure set access function name. The function name is the sidl name with the "." scope separators replaced by underscores followed by "__set_data".

Parameters:
id - the SymbolID of the Symbol.

getPrivateDestructor

public static java.lang.String getPrivateDestructor(SymbolID id)
Convert a symbol name into its private destructor function name provided by the SkelSource.

Parameters:
id - the SymbolID of the Symbol.

getSymbolName

public static java.lang.String getSymbolName(SymbolID id)
Convert a symbol name into an IOR identifier. This method replaces the "." scope separators in the symbol by underscores.

Parameters:
id - the SymbolID of the Symbol.

getEnumName

public static java.lang.String getEnumName(SymbolID id)
Convert a sidl enumerated type into its symbol name, which is "enum " followed by the symbol name followed by "__enum".

Parameters:
id - the SymbolID of the Symbol.

getObjectName

public static java.lang.String getObjectName(SymbolID id)
Convert a sidl symbol name into its object name -- for the purposes of this package that means convert it into its typedef object name. The typedef name is the sidl symbol name with the "." scope separators replaced by underscores.

Parameters:
id - the SymbolID of the Symbol.

getSetEPVName

public static java.lang.String getSetEPVName(SymbolID id)
Convert a sidl symbol into the name of its associated set EPV method, which is the symbol name appended with "__set_epv".

Parameters:
id - the SymbolID of the Symbol.

getSetSEPVName

public static java.lang.String getSetSEPVName(SymbolID id)
Convert a sidl symbol into the name of its associated set static EPV method, which is the symbol name appended with "__set_sepv".

Parameters:
id - the SymbolID of the Symbol.

getReturnString

public static java.lang.String getReturnString(Type type)
                                        throws CodeGenerationException
Generate a C return string for the specified sidl type. Most of the sidl return strings are listed in the static structures defined at the start of the class. Symbol types and array types require special processing.

Parameters:
type - the Type whose return string is being built.
Throws:
CodeGenerationException

getArgumentString

public static java.lang.String getArgumentString(Argument arg)
                                          throws CodeGenerationException
Generate a C argument string for the specified sidl argument. The formal argument name is not included.

Throws:
CodeGenerationException

getArgumentWithFormal

public static java.lang.String getArgumentWithFormal(Argument arg)
                                              throws CodeGenerationException
Generate a C argument string with the formal argument name.

Throws:
CodeGenerationException

getMethodImplName

public static java.lang.String getMethodImplName(SymbolID id,
                                                 java.lang.String methodName)
Generate the impl method's name.

Parameters:
id - the SymbolID of the Symbol associated with the method.

getMethodSkelName

public static java.lang.String getMethodSkelName(SymbolID id,
                                                 Method method)
Generate the skel method's name. In most cases, the skel name is the impl name except when the method has an array with an ordering specification.

Parameters:
id - the SymbolID of the Symbol associated with the method.
method - the method

getFullMethodName

public static java.lang.String getFullMethodName(SymbolID id,
                                                 Method method)
Generate the full method name associated with the symbol id and the specified method. The returned name prepends the symbol name and only one underbar to the method's name.

Parameters:
id - the SymbolID of the Symbol associated with the method.
method - the Method whose full name is being built.

getFullMethodName

public static java.lang.String getFullMethodName(SymbolID id,
                                                 java.lang.String methodName)
Generate the full method name associated with the symbol id and the specified method. The returned name prepends the symbol name and only one underbar to the method's name.

Parameters:
id - the SymbolID of the Symbol associated with the method.

getEnsureArray

public static java.lang.String getEnsureArray(Type arrayType)

getDelRefArray

public static java.lang.String getDelRefArray(Type arrayType)

getExceptionType

public static java.lang.String getExceptionType()