gov.llnl.babel.backend

Class IOR


public class IOR
extends java.lang.Object

Class IOR contains common SIDL to IOR translation routines shared by the backend code generators. This class simply collects many common IOR language bindings into one place.

Nested Class Summary

static class
IOR.CompareMethods

Field Summary

static int
BASE_EPV
static int
CAST
The index of the builtin method for casting.
static int
CHECKS
The index of the builtin method for setting the assertion checking.
static int
CHECK_ERROR
The index of the builtin method for assertion checking implementation.
static int
CLASS_BUILTIN_METHODS
The number of builtin methods that a class has.
static int
CONSTRUCTOR
The index of the builtin method for constructing a class instance
static int
CONSTRUCTOR2
The index of the special builtin method for constructing a class instance with user passed in private data
static String
DEFAULT_CHECK_LEVEL
Some assertion checking defaults...at least until we provide another mechanism.
static String
DEFAULT_OPTION_HOOKS
static String
DEFAULT_THRESHOLD
static int
DELETE
The index of the builtin method for deleting an object.
static int
DESTRUCTOR
The index of the builtin method for destructing a class instance
static int
DUMP_STATS
The index of the builtin method for dumping assertion checking data.
static String
D_CALLS
static String
D_CHECKS
static String
D_CONTROLS
static String
D_COUNTDOWN
static String
D_DATA
static String
D_HOOKS
static String
D_METHOD_CONTROLS
static String
D_METHOD_EXCEPT
static String
D_RATE
static String
D_SUCCESSES
static String
D_TRIES
static int
EPV_ARG
static int
EPV_NEW
static int
EPV_OLD
static int
EPV_REMOTE
static int
EPV_STATIC
static int
EXEC
The index of the builtin method for executing a named method.
static String
FUND_EXCEPTION_CALL_PREFIX
static String
GENERIC_POST_SUFFIX
static String
GENERIC_PRE_SUFFIX
static int
GENERIC_SUFFIX_MAXLEN
static int
GETURL
The index of the builtin method for getting the object's URL.
static int
HOOKS
The index of the builtin method for enabling/disabling hooks execution.
static int
INTERFACE_BUILTIN_METHODS
The number of builtin methods that an interface has.
static String
INVARIANT_CALL_PREFIX
static int
ISREMOTE
The index of the builtin method for determining if an object is remote.
static int
LOAD
The index of the builtin method for initializing a class (before first instance, or static method is called).
static int
MAJOR_VERSION
static int
MINOR_VERSION
static String
POSTCONDITION_CALL_PREFIX
static String
PRECONDITION_CALL_PREFIX
static int
PUBLIC_EPV
static int
RADDREF
The index of the builtin method for determining if an object is local.
static int
SET_ASSERTIONS
static int
SET_HOOKS
static int
SET_PUBLIC
static String
S_CONTROLS
static String
S_DUMP_FILE
static String
S_FULL_STATS_MACRO
static String
S_TEXT_STATS_MACRO
static String
s_static_suffix

Method Summary

static String
classToInterfacePtr(Class cls, Extendable e, String self)
Generate an expression to obtain a pointer to an interface or subclass from an object pointer.
static void
declareEPVsAsArgs(LanguageWriterForC lw, Class cls, boolean first)
static void
generateArgumentList(LanguageWriterForC writer, Context context, String self, boolean is_interface, SymbolID id, Method method, boolean in_signature, boolean add_type, boolean obj_ptr, String exc_var, boolean do_return, boolean do_indices, boolean do_rarrays, boolean isExec)
Generate the method's argument list.
static void
generateArgumentList(LanguageWriterForC writer, Context context, String self, boolean is_interface, SymbolID id, Method method, boolean in_signature, boolean add_type, boolean obj_ptr, boolean do_throws, boolean do_return, boolean do_indices, boolean do_rarrays)
Generate the method's argument list.
static void
generateArguments(LanguageWriterForC writer, Context context, String self, List args, boolean isStatic, String excVar, Type returnType, boolean addType, boolean objPtr, boolean doRaw, boolean deref_inout, boolean isExec)
Generate the specified argument list.
static void
generateArguments(LanguageWriterForC writer, Context context, String self, List args, boolean isStatic, boolean doThrows, Type returnType, boolean addType, boolean objPtr, boolean doRaw, boolean deref_inout)
Generate the specified argument list.
static void
generateCastFunction(Class cls, String self, LanguageWriterForC writer, boolean rmi, boolean addref)
Generate the cast function for a class.
static void
generateStaticEPVVariables(LanguageWriterForC lw, Extendable ext, boolean has_static, boolean is_remote, int setType)
Generate the static EPV variables for the specified extendable and EPV type.
static String
getArgumentString(Argument arg, Context context)
Generate an argument string for the specified SIDL argument.
static String
getArgumentString(Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec)
Generate a C argument string for the specified SIDL argument.
static String
getArgumentString(Method method, Context context)
Generate a string containing only the specified method's arguments, including exceptions, if any.
static String
getArgumentWithFormal(Argument arg, Context context)
Generate an argument string with the formal argument name.
static String
getArgumentWithFormal(Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec)
Generate a C argument string with the formal argument name.
static String
getArrayName(SymbolID id)
Convert a SIDL symbol into its array representation, which is "struct " followed by the symbol name followed by "__array".
static String
getArrayName(int intType)
Get the sidl array name for a given type.
static String
getArrayNameForFunctions(int intType)
Gets the sidl array name for a given type, for use in C functions.
static String
getArrayNameWithoutAsterix(int intType)
Gets the sidl array name for a given type, and removes the trailing asterix.
static String
getBuiltinComment(int index)
Return the comment for the specified builtin method.
static Method
getBuiltinMethod(int index, SymbolID id, Context context)
Return the method description of a particular non-static builtin method.
static Method
getBuiltinMethod(int index, SymbolID id, Context context, boolean sVersion)
Return the method description of a particular builtin method.
static String
getBuiltinName(int index)
Return the normal name of the builtin method.
static String
getBuiltinName(int index, boolean sVersion)
Return the name of the specified version of the builtin method.
static String
getCallLoadName(SymbolID id)
Convert a sidl symbol into the name of its associated _call_load method which is the symbol name appended with "__call_load"
static String
getCast(Method method, String self, Context context)
Generate a cast string for the specified method.
static String
getClassType()
Return the name of the type of the implicit base class type.
static String
getControlsStruct(SymbolID id)
Convert a SIDL symbol into its control structure.
static String
getEPVName(SymbolID id)
Convert a SIDL symbol into its method entry point vector (EPV) name.
static String
getEPVPrefix(int epvType)
Return the static EPV prefix string or, if invalid, the one with the minimum type value.
static String
getEPVType(int type)
Return the type associated with the specified EPV type index, or an empty string if the index is out of range.
static String
getEPVVar(int type)
Return the standard method entry point vector (EPV) variable.
static 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 String
getEnumValueSymbol(SymbolID id, String value)
Return the enum value symbol for a particular enum type and string.
static String
getExceptionFundamentalType()
Return the name of the type of the implicit exception argument; namely, sidl_BaseInterface__object.
static String
getExternalFunc(SymbolID id)
Get the name of the function that returns the structure of external entry points.
static String
getExternalName(SymbolID id)
Get struct name for extern entry point structure.
static String
getExternalVariableName(SymbolID id)
Get struct name for extern entry point variable.
static Set
getFCastSymbolIDs(Extendable ext)
Returns a Set containing all the Symbol IDs that need FCast methods generated for them in this Extendable.
static Set
getFConnectSymbolIDs(Extendable ext)
Returns a Set containing all the Symbol IDs that need FConnect methods generated for them in this Extendable.
static String
getFiniName(SymbolID id)
Convert a SIDL symbol into the name of its associated fini method, which is the symbol name appended with "__fini".
static String
getGetEPVsName(SymbolID id)
Convert a SIDL symbol into its method that returns initialized epv pointers.
static String
getHaveLockStaticGlobalsMacroName()
A CPP macro name
static String
getHeaderFile(SymbolID id)
Generate the header filename associated with a symbol identifier.
static String
getInitEPVName(SymbolID id)
Convert a SIDL symbol into the name of its associated init method, which is the symbol name appended with "__init".
static String
getInitName(SymbolID id)
Convert a SIDL symbol into the name of its associated init method, which is the symbol name appended with "__init".
static String
getInitialValue(Type type)
Gives an initial value based on the type of the argument
static String
getInterfaceType()
Return the name of the type of the base interface type.
static String
getInvariantExceptType()
static String
getLocalStaticsName(SymbolID id)
Convert a SIDL symbol into the name of its associated local statics method.
static String
getLockStaticGlobalsMacroName()
A CPP Macro Name
static String
getMethodControlsStruct(SymbolID id)
Convert a SIDL symbol into its method control structure.
static String
getMethodDescDataName(SymbolID id)
Return the name of the static variable associated with the method description data.
static String
getMethodDescDataStruct(SymbolID id)
Return the name of the method description data structure name.
static String
getMethodIndex(SymbolID id, String lit)
Return the method index constant name associated with the specified literal.
static String
getMethodIndex(SymbolID id, Method meth)
Return the method index constant name associated with the specified method.
static String
getMethodName(SymbolID id, String name)
Returns the name of the built-in method, prepending "ior_" and the name of the symbol.
static String
getNewName(SymbolID id)
Convert a SIDL symbol into the name of its associated constructor, which is the symbol name appended with "__new".
static String
getObjectName(String fqn)
Convert a SIDL interface or class into its symbol name, which is "struct " followed by the symbol name followed by "__object".
static String
getObjectName(SymbolID id)
Convert a SIDL interface or class into its symbol name, which is "struct " followed by the symbol name followed by "__object".
static String
getPostEPVName(SymbolID id)
Convert a SIDL symbol into its Post hooks method entry point vector (EPV) name.
static String
getPostSEPVName(SymbolID id)
Convert a SIDL symbol into its post hooks static entry point vector (SEPV) name.
static String
getPostconditionExceptType()
static String
getPreEPVName(SymbolID id)
Convert a SIDL symbol into its Pre hooks method entry point vector (EPV) name.
static String
getPreSEPVName(SymbolID id)
Convert a SIDL symbol into its pre hooks static entry point vector (SEPV) name.
static String
getPreconditionExceptType()
static String
getRaddRefName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".
static String
getRemoteCastName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote cast, which is the symbol name appended with "__rmicast".
static String
getRemoteConnectName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote connector, which is the symbol name appended with "__connect".
static String
getRemoteGetURLName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".
static String
getRemoteIsRemoteName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".
static String
getRemoteName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote constructor, which is the symbol name appended with "__remote".
static String
getRemoteStructName(SymbolID id)
Convert a SIDL interface or class into its remote struct name, which is "struct " followed by the symbol name followed by "__remote".
static String
getReturnString(Type type, Context context)
Generate a return string for the specified SIDL type.
static String
getReturnString(Type type, Context context, boolean objPtr, boolean inStub)
Generate a C return string for the specified SIDL type.
static SymbolID
getRuntimeException(Context context)
static Symbol
getRuntimeExceptionSymbol(Context context)
static String
getSEPVName(SymbolID id)
Convert a SIDL symbol into its static entry point vector (SEPV) name.
static String
getSetEPVName(SymbolID id)
Convert a SIDL symbol into the name of its set EPV method.
static String
getSetEPVTypeName(int type)
Returns the name of the set EPV type.
static String
getSetSEPVName(SymbolID id)
Convert a SIDL symbol into the name of its set static EPV method.
static String
getSkelFCastName(SymbolID sourceid, SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector.
static String
getSkelFConnectName(SymbolID sourceid, SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector.
static String
getSkelSerializationName(SymbolID extid, SymbolID structid, boolean serialize)
static String
getSourceFile(SymbolID id)
Generate the source filename associated with a symbol identifier.
static String
getStaticEPVVariable(SymbolID id, int epvType, int setType)
Return the name of the specified static EPV variable.
static String
getStaticTypeOption(SymbolID id, int type)
Return the static epv type option name.
static String
getStaticsName(SymbolID id)
Convert a SIDL symbol into the name of its associated statics method, which is the symbol name appended with "__statics".
static String
getStructName(SymbolID id)
Convert a SIDL struct into its IOR data type name, which is "struct " followed by the symbol name followed by "__data".
static Set
getStructSymbolIDs(Extendable ext, boolean serialize)
Returns a Set containing all the Symbol IDs of structs that need serialize/deserialize methods generated for them in this Extendable.
static String
getSymbolName(String name)
Convert a symbol name into an IOR identifier.
static String
getSymbolName(SymbolID id)
Convert a symbol name into an IOR identifier.
static String
getSymbolType(Symbol sym)
static String
getUnlockStaticGlobalsMacroName()
A CPP macro name
static String
getVectorEntry(String methodName)
Generate the name of an entry in the entry point vector or the static entry point vector.
static String
getVersionName(SymbolID id)
Convert a SIDL symbol into the name of its associated fini method, which is the symbol name appended with "__fini".
static boolean
hasStaticBuiltin(int index)
Return TRUE if there is a builtin static version of the method; FALSE otherwise.
static boolean
isBuiltinAssert(int ind)
Return TRUE if the index is associated with an assertion related built-in method, FALSE otherwise.
static boolean
isBuiltinBasic(int ind)
Return TRUE if the index is associated with a basic built-in method, FALSE otherwise.
static boolean
isBuiltinMethod(String methodName)
Return TRUE if the method name is one of the non-static built-in methods, FALSE otherwise.
static boolean
isBuiltinMethod(String methodName, boolean sVersion)
Return TRUE if the method name is one of the built-in methods, FALSE otherwise.
static boolean
isSIDLSymbol(SymbolID id)
Return TRUE if the extendable is a SIDL symbol; FALSE otherwise.
static boolean
isUnserializable(Context context, Struct strct)
static boolean
isUnserializable(Context context, Type t)
static void
resolveRenamedMethods(Extendable ext, HashMap renames)
static boolean
supportAssertions(Extendable ext, Context context)
Return TRUE if assertion checking needs to be supported; FALSE otherwise.
static boolean
supportBaseEPVAttr(Extendable ext, Context context)
Return TRUE if the base EPV attribute needs to be supported; FALSE otherwise.
static boolean
supportHooks(Extendable ext, Context context)
Return TRUE if hooks need to be supported; FALSE otherwise.
static boolean
supportHooks(SymbolID id, Context context)
Return TRUE if hooks need to be supported; FALSE otherwise.

Field Details

BASE_EPV

public static final int BASE_EPV
Field Value:
1

CAST

public static final int CAST
The index of the builtin method for casting.
Field Value:
0

CHECKS

public static final int CHECKS
The index of the builtin method for setting the assertion checking.
Field Value:
11

CHECK_ERROR

public static final int CHECK_ERROR
The index of the builtin method for assertion checking implementation.
Field Value:
12

CLASS_BUILTIN_METHODS

public static final int CLASS_BUILTIN_METHODS
The number of builtin methods that a class has. Builtin methods are implicitly defined methods that are required for the inner workings of the IOR or to support the language bindings. The names of the builtins are numbers 0...CLASS_BUILTIN_METHODS-1 and are available from the method getBuiltinMethod.
Field Value:
14

CONSTRUCTOR

public static final int CONSTRUCTOR
The index of the builtin method for constructing a class instance
Field Value:
7

CONSTRUCTOR2

public static final int CONSTRUCTOR2
The index of the special builtin method for constructing a class instance with user passed in private data
Field Value:
8

DEFAULT_CHECK_LEVEL

public static final String DEFAULT_CHECK_LEVEL
Some assertion checking defaults...at least until we provide another mechanism.

DEFAULT_OPTION_HOOKS

public static final String DEFAULT_OPTION_HOOKS

DEFAULT_THRESHOLD

public static final String DEFAULT_THRESHOLD

DELETE

public static final int DELETE
The index of the builtin method for deleting an object.
Field Value:
1

DESTRUCTOR

public static final int DESTRUCTOR
The index of the builtin method for destructing a class instance
Field Value:
9

DUMP_STATS

public static final int DUMP_STATS
The index of the builtin method for dumping assertion checking data.
Field Value:
13

D_CALLS

public static final String D_CALLS

D_CHECKS

public static final String D_CHECKS

D_CONTROLS

public static final String D_CONTROLS

D_COUNTDOWN

public static final String D_COUNTDOWN

D_DATA

public static final String D_DATA

D_HOOKS

public static final String D_HOOKS

D_METHOD_CONTROLS

public static final String D_METHOD_CONTROLS

D_METHOD_EXCEPT

public static final String D_METHOD_EXCEPT

D_RATE

public static final String D_RATE

D_SUCCESSES

public static final String D_SUCCESSES

D_TRIES

public static final String D_TRIES

EPV_ARG

public static final int EPV_ARG
Field Value:
4

EPV_NEW

public static final int EPV_NEW
Field Value:
0

EPV_OLD

public static final int EPV_OLD
Field Value:
1

EPV_REMOTE

public static final int EPV_REMOTE
Field Value:
2

EPV_STATIC

public static final int EPV_STATIC
Field Value:
3

EXEC

public static final int EXEC
The index of the builtin method for executing a named method.
Field Value:
2

FUND_EXCEPTION_CALL_PREFIX

public static String FUND_EXCEPTION_CALL_PREFIX

GENERIC_POST_SUFFIX

public static final String GENERIC_POST_SUFFIX

GENERIC_PRE_SUFFIX

public static final String GENERIC_PRE_SUFFIX

GENERIC_SUFFIX_MAXLEN

public static final int GENERIC_SUFFIX_MAXLEN
Field Value:
5

GETURL

public static final int GETURL
The index of the builtin method for getting the object's URL.
Field Value:
3

HOOKS

public static final int HOOKS
The index of the builtin method for enabling/disabling hooks execution.
Field Value:
6

INTERFACE_BUILTIN_METHODS

public static final int INTERFACE_BUILTIN_METHODS
The number of builtin methods that an interface has. Builtin methods are implicitly defined methods that are required for the inner workings of the IOR or to support the language bindings. The names of the builtins are numbers 0...INTERFACE_BUILTIN_METHODS-1 and are available from the method getBuiltinMethod.
Field Value:
7
See Also:
getBuiltinMethod

INVARIANT_CALL_PREFIX

public static String INVARIANT_CALL_PREFIX

ISREMOTE

public static final int ISREMOTE
The index of the builtin method for determining if an object is remote.
Field Value:
5

LOAD

public static final int LOAD
The index of the builtin method for initializing a class (before first instance, or static method is called).
Field Value:
10

MAJOR_VERSION

public static final int MAJOR_VERSION
Field Value:
2

MINOR_VERSION

public static final int MINOR_VERSION
Field Value:
0

POSTCONDITION_CALL_PREFIX

public static String POSTCONDITION_CALL_PREFIX

PRECONDITION_CALL_PREFIX

public static String PRECONDITION_CALL_PREFIX

PUBLIC_EPV

public static final int PUBLIC_EPV
Field Value:
0

RADDREF

public static final int RADDREF
The index of the builtin method for determining if an object is local.
Field Value:
4

SET_ASSERTIONS

public static final int SET_ASSERTIONS
Field Value:
1

SET_HOOKS

public static final int SET_HOOKS
Field Value:
2

SET_PUBLIC

public static final int SET_PUBLIC
Field Value:
0

S_CONTROLS

public static final String S_CONTROLS

S_DUMP_FILE

public static final String S_DUMP_FILE

S_FULL_STATS_MACRO

public static final String S_FULL_STATS_MACRO

S_TEXT_STATS_MACRO

public static final String S_TEXT_STATS_MACRO

s_static_suffix

public static final String s_static_suffix

Method Details

classToInterfacePtr

public static String classToInterfacePtr(Class cls,
                                         Extendable e,
                                         String self)
            throws CodeGenerationException
Generate an expression to obtain a pointer to an interface or subclass from an object pointer.
Parameters:
cls - the object pointer self is a class pointer to this type
e - this is the type of the interface/subclass pointer to be obtained
self - this string holds the name to the object pointer that the interface/subclass pointer will be obtained from
Returns:
a String containing the expression to cast & (if necessary) dereference the self pointer to the appropriate internal data structure

declareEPVsAsArgs

public static void declareEPVsAsArgs(LanguageWriterForC lw,
                                     Class cls,
                                     boolean first)

generateArgumentList

public static void generateArgumentList(LanguageWriterForC writer,
                                        Context context,
                                        String self,
                                        boolean is_interface,
                                        SymbolID id,
                                        Method method,
                                        boolean in_signature,
                                        boolean add_type,
                                        boolean obj_ptr,
                                        String exc_var,
                                        boolean do_return,
                                        boolean do_indices,
                                        boolean do_rarrays,
                                        boolean isExec)
            throws CodeGenerationException
Generate the method's argument list.
Parameters:
writer - the language writer.
self - the String representing the method's self argument name.
is_interface - the boolean indicating whether working with a class or an interface.
id - the SymbolID of the Extendable whose stub source is being written.
method - the Method whose list is being output.
in_signature - the boolean indicating whether the argument list is being generated in a signature.
add_type - the boolean indicating whether the argument types are to be added.
exc_var - the variable to be used for the exception argument; NULL if no exception argument to be generated.
do_return - the boolean indicating whether the return type is to be added.
do_rarrays - the boolean indicating if special raw array argument handling is needed.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

generateArgumentList

public static void generateArgumentList(LanguageWriterForC writer,
                                        Context context,
                                        String self,
                                        boolean is_interface,
                                        SymbolID id,
                                        Method method,
                                        boolean in_signature,
                                        boolean add_type,
                                        boolean obj_ptr,
                                        boolean do_throws,
                                        boolean do_return,
                                        boolean do_indices,
                                        boolean do_rarrays)
            throws CodeGenerationException
Generate the method's argument list.
Parameters:
writer - the language writer.
self - the String representing the method's self argument name.
is_interface - the boolean indicating whether working with a class or an interface.
id - the SymbolID of the Extendable whose stub source is being written.
method - the Method whose list is being output.
in_signature - the boolean indicating whether the argument list is being generated in a signature.
add_type - the boolean indicating whether the argument types are to be added.
do_throws - the boolean indicating whether the exception is to be added.
do_return - the boolean indicating whether the return type is to be added.
do_rarrays - the boolean indicating if special raw array argument handling is needed.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

generateArguments

public static void generateArguments(LanguageWriterForC writer,
                                     Context context,
                                     String self,
                                     List args,
                                     boolean isStatic,
                                     String excVar,
                                     Type returnType,
                                     boolean addType,
                                     boolean objPtr,
                                     boolean doRaw,
                                     boolean deref_inout,
                                     boolean isExec)
            throws CodeGenerationException
Generate the specified argument list.
Parameters:
writer - the language writer.
self - the String representing the method's self argument name.
args - the basic argument list for the method.
isStatic - the boolean indicating whether the method is static.
excVar - the variable to be used for the exception argument; NULL if no exception argument to be generated.
returnType - the return type of the method OR null if the method return type should not be included.
objPtr - TRUE if the object pointer type should be returned; FALSE otherwise.
doRaw - the boolean indicating if special raw array argument handling is needed.
deref_inout - if true, out and inout arguments are dereferenced in passing. (Used for pre and post hooks)
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

generateArguments

public static void generateArguments(LanguageWriterForC writer,
                                     Context context,
                                     String self,
                                     List args,
                                     boolean isStatic,
                                     boolean doThrows,
                                     Type returnType,
                                     boolean addType,
                                     boolean objPtr,
                                     boolean doRaw,
                                     boolean deref_inout)
            throws CodeGenerationException
Generate the specified argument list.
Parameters:
writer - the language writer.
self - the String representing the method's self argument name.
args - the basic argument list for the method.
isStatic - the boolean indicating whether the method is static.
doThrows - the boolean indicating if an exception argument is to be added.
returnType - the return type of the method OR null if the method return type should not be included.
objPtr - TRUE if the object pointer type should be returned; FALSE otherwise.
doRaw - the boolean indicating if special raw array argument handling is needed.
deref_inout - if true, out and inout arguments are dereferenced in passing. (Used for pre and post hooks)
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

generateCastFunction

public static void generateCastFunction(Class cls,
                                        String self,
                                        LanguageWriterForC writer,
                                        boolean rmi,
                                        boolean addref)
            throws CodeGenerationException
Generate the cast function for a class. This will return null if the cast is invalid and a pointer to the object otherwise. The logic generates tests for the current class and then recursively queries the parent classes.

generateStaticEPVVariables

public static void generateStaticEPVVariables(LanguageWriterForC lw,
                                              Extendable ext,
                                              boolean has_static,
                                              boolean is_remote,
                                              int setType)
Generate the static EPV variables for the specified extendable and EPV type.

getArgumentString

public static String getArgumentString(Argument arg,
                                       Context context)
            throws CodeGenerationException
Generate an argument string for the specified SIDL argument. The formal argument name is not included.
Parameters:
arg - the Argument whose string is being built.

getArgumentString

public static String getArgumentString(Argument arg,
                                       Context context,
                                       boolean objPtr,
                                       boolean inStub,
                                       boolean isExec)
            throws CodeGenerationException
Generate a C argument string for the specified SIDL argument. The formal argument name is not included.
Parameters:
arg - the Argument whose string is being built.
objPtr - TRUE if the object pointer type should be returned; FALSE otherwise.
inStub - TRUE is the string is for the stub; FALSE otherwise.
isExec - TRUE if the string is for declaring variables in an Exec function, FALSE otherwise

getArgumentString

public static String getArgumentString(Method method,
                                       Context context)
            throws CodeGenerationException
Generate a string containing only the specified method's arguments, including exceptions, if any.

getArgumentWithFormal

public static String getArgumentWithFormal(Argument arg,
                                           Context context)
            throws CodeGenerationException
Generate an argument string with the formal argument name.
Parameters:
arg - the Argument whose string is being built.

getArgumentWithFormal

public static String getArgumentWithFormal(Argument arg,
                                           Context context,
                                           boolean objPtr,
                                           boolean inStub,
                                           boolean isExec)
            throws CodeGenerationException
Generate a C argument string with the formal argument name.
Parameters:
arg - the Argument whose string is being built.
objPtr - TRUE if the object pointer type should be returned; FALSE otherwise.
inStub - TRUE if the string is for the stub; FALSE otherwise.
isExec - TRUE if the string is generated for an exec function

getArrayName

public static String getArrayName(SymbolID id)
Convert a SIDL symbol into its array representation, which is "struct " followed by the symbol name followed by "__array". Passing null to this function causes it to return the generic (typeless) SIDL array.

getArrayName

public static String getArrayName(int intType)
Get the sidl array name for a given type. Use the arrayType from the array.

getArrayNameForFunctions

public static String getArrayNameForFunctions(int intType)
Gets the sidl array name for a given type, for use in C functions.

getArrayNameWithoutAsterix

public static String getArrayNameWithoutAsterix(int intType)
Gets the sidl array name for a given type, and removes the trailing asterix. Use the arrayType from the array.

getBuiltinComment

public static String getBuiltinComment(int index)
Return the comment for the specified builtin method.
Parameters:
index - the index of the builtin method that is desired. Generally, one of CAST, DELETE, CONSTRUCTOR, or DESTRUCTOR though others possible.

getBuiltinMethod

public static Method getBuiltinMethod(int index,
                                      SymbolID id,
                                      Context context)
            throws CodeGenerationException
Return the method description of a particular non-static builtin method. This will raise an ArrayIndexOutOfBoundsException if index is less than zero or greater than or equal to the number of builtin methods.
Parameters:
index - the index of the desired builtin method.
id - the name of the symbol
Returns:
a description the method.

getBuiltinMethod

public static Method getBuiltinMethod(int index,
                                      SymbolID id,
                                      Context context,
                                      boolean sVersion)
            throws CodeGenerationException
Return the method description of a particular builtin method. This will raise an ArrayIndexOutOfBoundsException if index is less than zero or greater than or equal to the number of builtin methods.
Parameters:
index - the index of the builtin method that is desired. Generally, one of CAST, DELETE, CONSTRUCTOR, or DESTRUCTOR though others possible.
id - the name of the symbol
sVersion - TRUE if the static version is desired; else FALSE
Returns:
a description the method.

getBuiltinName

public static String getBuiltinName(int index)
Return the normal name of the builtin method.
Parameters:
index - the index of the desired builtin method.

getBuiltinName

public static String getBuiltinName(int index,
                                    boolean sVersion)
Return the name of the specified version of the builtin method.
Parameters:
index - the index of the builtin method that is desired. Generally, one of CAST, DELETE, CONSTRUCTOR, or DESTRUCTOR though others possible.
sVersion - TRUE if the static version is desired; FALSE otherwise.

getCallLoadName

public static String getCallLoadName(SymbolID id)
Convert a sidl symbol into the name of its associated _call_load method which is the symbol name appended with "__call_load"

getCast

public static String getCast(Method method,
                             String self,
                             Context context)
            throws CodeGenerationException
Generate a cast string for the specified method. The string argument self represents the name of the object. A code generation exception is thrown if any of the required symbols do not exist in the symbol table.

getClassType

public static String getClassType()
Return the name of the type of the implicit base class type. The return value is of the form "struct X_Y_Z *" where X_Y_Z depends on the name of the base class and its mapping to a C struct name.

getControlsStruct

public static String getControlsStruct(SymbolID id)
Convert a SIDL symbol into its control structure.

getEPVName

public static String getEPVName(SymbolID id)
Convert a SIDL symbol into its method entry point vector (EPV) name.

getEPVPrefix

public static String getEPVPrefix(int epvType)
Return the static EPV prefix string or, if invalid, the one with the minimum type value.

getEPVType

public static String getEPVType(int type)
Return the type associated with the specified EPV type index, or an empty string if the index is out of range.

getEPVVar

public static String getEPVVar(int type)
Return the standard method entry point vector (EPV) variable.

getEnumName

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

getEnumValueSymbol

public static String getEnumValueSymbol(SymbolID id,
                                        String value)
Return the enum value symbol for a particular enum type and string.

getExceptionFundamentalType

public static String getExceptionFundamentalType()
Return the name of the type of the implicit exception argument; namely, sidl_BaseInterface__object. This is deemed necessary in order to minimize the impact on existing Impl codes due to the memory layout of the epv. That is, it is not necessary for the implementation writer to cast a newly created exception (to the base exception interface) IF the pointer is declared to be the start of the epv structure to begin with.

getExternalFunc

public static String getExternalFunc(SymbolID id)
Get the name of the function that returns the structure of external entry points.

getExternalName

public static String getExternalName(SymbolID id)
Get struct name for extern entry point structure.

getExternalVariableName

public static String getExternalVariableName(SymbolID id)
Get struct name for extern entry point variable.

getFCastSymbolIDs

public static Set getFCastSymbolIDs(Extendable ext)
            throws CodeGenerationException
Returns a Set containing all the Symbol IDs that need FCast methods generated for them in this Extendable.

getFConnectSymbolIDs

public static Set getFConnectSymbolIDs(Extendable ext)
            throws CodeGenerationException
Returns a Set containing all the Symbol IDs that need FConnect methods generated for them in this Extendable.

getFiniName

public static String getFiniName(SymbolID id)
Convert a SIDL symbol into the name of its associated fini method, which is the symbol name appended with "__fini".

getGetEPVsName

public static String getGetEPVsName(SymbolID id)
Convert a SIDL symbol into its method that returns initialized epv pointers.

getHaveLockStaticGlobalsMacroName

public static String getHaveLockStaticGlobalsMacroName()
A CPP macro name

getHeaderFile

public static 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 "_IOR.h".

getInitEPVName

public static String getInitEPVName(SymbolID id)
Convert a SIDL symbol into the name of its associated init method, which is the symbol name appended with "__init".

getInitName

public static String getInitName(SymbolID id)
Convert a SIDL symbol into the name of its associated init method, which is the symbol name appended with "__init".

getInitialValue

public static String getInitialValue(Type type)
            throws CodeGenerationException
Gives an initial value based on the type of the argument
Parameters:
type - the Type whose return string is being built.

getInterfaceType

public static String getInterfaceType()
Return the name of the type of the base interface type. The return value is of the form "struct X_Y_Z *" where X_Y_Z depends on the name of the base interface and its mapping to a C struct name.

getInvariantExceptType

public static String getInvariantExceptType()

getLocalStaticsName

public static String getLocalStaticsName(SymbolID id)
Convert a SIDL symbol into the name of its associated local statics method.

getLockStaticGlobalsMacroName

public static String getLockStaticGlobalsMacroName()
A CPP Macro Name

getMethodControlsStruct

public static String getMethodControlsStruct(SymbolID id)
Convert a SIDL symbol into its method control structure.

getMethodDescDataName

public static String getMethodDescDataName(SymbolID id)
Return the name of the static variable associated with the method description data.

getMethodDescDataStruct

public static String getMethodDescDataStruct(SymbolID id)
Return the name of the method description data structure name.

getMethodIndex

public static String getMethodIndex(SymbolID id,
                                    String lit)
Return the method index constant name associated with the specified literal.

getMethodIndex

public static String getMethodIndex(SymbolID id,
                                    Method meth)
Return the method index constant name associated with the specified method.

getMethodName

public static String getMethodName(SymbolID id,
                                   String name)
Returns the name of the built-in method, prepending "ior_" and the name of the symbol.

getNewName

public static String getNewName(SymbolID id)
Convert a SIDL symbol into the name of its associated constructor, which is the symbol name appended with "__new".

getObjectName

public static String getObjectName(String fqn)
Convert a SIDL interface or class into its symbol name, which is "struct " followed by the symbol name followed by "__object".

getObjectName

public static String getObjectName(SymbolID id)
Convert a SIDL interface or class into its symbol name, which is "struct " followed by the symbol name followed by "__object".

getPostEPVName

public static String getPostEPVName(SymbolID id)
Convert a SIDL symbol into its Post hooks method entry point vector (EPV) name.

getPostSEPVName

public static String getPostSEPVName(SymbolID id)
Convert a SIDL symbol into its post hooks static entry point vector (SEPV) name.

getPostconditionExceptType

public static String getPostconditionExceptType()

getPreEPVName

public static String getPreEPVName(SymbolID id)
Convert a SIDL symbol into its Pre hooks method entry point vector (EPV) name.

getPreSEPVName

public static String getPreSEPVName(SymbolID id)
Convert a SIDL symbol into its pre hooks static entry point vector (SEPV) name.

getPreconditionExceptType

public static String getPreconditionExceptType()

getRaddRefName

public static String getRaddRefName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".

getRemoteCastName

public static String getRemoteCastName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote cast, which is the symbol name appended with "__rmicast".

getRemoteConnectName

public static String getRemoteConnectName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote connector, which is the symbol name appended with "__connect".

getRemoteGetURLName

public static String getRemoteGetURLName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".

getRemoteIsRemoteName

public static String getRemoteIsRemoteName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".

getRemoteName

public static String getRemoteName(SymbolID id)
Convert a SIDL symbol into the name of its associated remote constructor, which is the symbol name appended with "__remote".

getRemoteStructName

public static String getRemoteStructName(SymbolID id)
Convert a SIDL interface or class into its remote struct name, which is "struct " followed by the symbol name followed by "__remote".

getReturnString

public static String getReturnString(Type type,
                                     Context context)
            throws CodeGenerationException
Generate a 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.

getReturnString

public static String getReturnString(Type type,
                                     Context context,
                                     boolean objPtr,
                                     boolean inStub)
            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.
objPtr - TRUE if the object pointer type should be returned; FALSE otherwise.
inStub - TRUE is the string is for the stub; FALSE otherwise.

getRuntimeException

public static SymbolID getRuntimeException(Context context)

getRuntimeExceptionSymbol

public static Symbol getRuntimeExceptionSymbol(Context context)

getSEPVName

public static String getSEPVName(SymbolID id)
Convert a SIDL symbol into its static entry point vector (SEPV) name.

getSetEPVName

public static String getSetEPVName(SymbolID id)
Convert a SIDL symbol into the name of its set EPV method.

getSetEPVTypeName

public static String getSetEPVTypeName(int type)
Returns the name of the set EPV type.

getSetSEPVName

public static String getSetSEPVName(SymbolID id)
Convert a SIDL symbol into the name of its set static EPV method.

getSkelFCastName

public static String getSkelFCastName(SymbolID sourceid,
                                      SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector. This requires both the SybmolID of the class this is being defined in (sourceid) and the SymbolID of the target class to be connected (targetid)

getSkelFConnectName

public static String getSkelFConnectName(SymbolID sourceid,
                                         SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector. This requires both the SybmolID of the class this is being defined in (sourceid) and the SymbolID of the target class to be connected (targetid)

getSkelSerializationName

public static String getSkelSerializationName(SymbolID extid,
                                              SymbolID structid,
                                              boolean serialize)

getSourceFile

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

getStaticEPVVariable

public static String getStaticEPVVariable(SymbolID id,
                                          int epvType,
                                          int setType)
Return the name of the specified static EPV variable.

getStaticTypeOption

public static String getStaticTypeOption(SymbolID id,
                                         int type)
Return the static epv type option name.

getStaticsName

public static String getStaticsName(SymbolID id)
Convert a SIDL symbol into the name of its associated statics method, which is the symbol name appended with "__statics".

getStructName

public static String getStructName(SymbolID id)
Convert a SIDL struct into its IOR data type name, which is "struct " followed by the symbol name followed by "__data".

getStructSymbolIDs

public static Set getStructSymbolIDs(Extendable ext,
                                     boolean serialize)
            throws CodeGenerationException
Returns a Set containing all the Symbol IDs of structs that need serialize/deserialize methods generated for them in this Extendable.

getSymbolName

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

getSymbolName

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

getSymbolType

public static String getSymbolType(Symbol sym)

getUnlockStaticGlobalsMacroName

public static String getUnlockStaticGlobalsMacroName()
A CPP macro name

getVectorEntry

public static String getVectorEntry(String methodName)
Generate the name of an entry in the entry point vector or the static entry point vector.
Parameters:
methodName - the name of the method that is an element in the entry point vector.

getVersionName

public static String getVersionName(SymbolID id)
Convert a SIDL symbol into the name of its associated fini method, which is the symbol name appended with "__fini".

hasStaticBuiltin

public static boolean hasStaticBuiltin(int index)
Return TRUE if there is a builtin static version of the method; FALSE otherwise.
Parameters:
index - the index of the desired builtin method.

isBuiltinAssert

public static boolean isBuiltinAssert(int ind)
Return TRUE if the index is associated with an assertion related built-in method, FALSE otherwise.

isBuiltinBasic

public static boolean isBuiltinBasic(int ind)
Return TRUE if the index is associated with a basic built-in method, FALSE otherwise.

isBuiltinMethod

public static boolean isBuiltinMethod(String methodName)
Return TRUE if the method name is one of the non-static built-in methods, FALSE otherwise.
Parameters:
methodName - the name of the method being checked

isBuiltinMethod

public static boolean isBuiltinMethod(String methodName,
                                      boolean sVersion)
Return TRUE if the method name is one of the built-in methods, FALSE otherwise.
Parameters:
methodName - the name of the method being checked
sVersion - TRUE if the static version is desired; FALSE otherwise.

isSIDLSymbol

public static boolean isSIDLSymbol(SymbolID id)
Return TRUE if the extendable is a SIDL symbol; FALSE otherwise.

isUnserializable

public static boolean isUnserializable(Context context,
                                       Struct strct)

isUnserializable

public static boolean isUnserializable(Context context,
                                       Type t)

resolveRenamedMethods

public static void resolveRenamedMethods(Extendable ext,
                                         HashMap renames)

supportAssertions

public static boolean supportAssertions(Extendable ext,
                                        Context context)
            throws CodeGenerationException
Return TRUE if assertion checking needs to be supported; FALSE otherwise.

supportBaseEPVAttr

public static boolean supportBaseEPVAttr(Extendable ext,
                                         Context context)
            throws CodeGenerationException
Return TRUE if the base EPV attribute needs to be supported; FALSE otherwise.

supportHooks

public static boolean supportHooks(Extendable ext,
                                   Context context)
Return TRUE if hooks need to be supported; FALSE otherwise.

supportHooks

public static boolean supportHooks(SymbolID id,
                                   Context context)
Return TRUE if hooks need to be supported; FALSE otherwise.