gov.llnl.babel.backend
Class IOR

java.lang.Object
  extended by gov.llnl.babel.backend.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 CHECK_ERROR
          The index of the builtin method for assertion checking implementation.
static int CHECKS
          The index of the builtin method for setting the assertion checking.
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 java.lang.String D_CALLS
           
static java.lang.String D_CHECKS
           
static java.lang.String D_CONTROLS
           
static java.lang.String D_COUNTDOWN
           
static java.lang.String D_DATA
           
static java.lang.String D_HOOKS
           
static java.lang.String D_METHOD_CONTROLS
           
static java.lang.String D_METHOD_EXCEPT
           
static java.lang.String D_RATE
           
static java.lang.String D_SUCCESSES
           
static java.lang.String D_TRIES
           
static java.lang.String DEFAULT_CHECK_LEVEL
          Some assertion checking defaults...at least until we provide another mechanism.
static java.lang.String DEFAULT_OPTION_HOOKS
           
static java.lang.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 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 java.lang.String FUND_EXCEPTION_CALL_PREFIX
           
static java.lang.String GENERIC_POST_SUFFIX
           
static java.lang.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 java.lang.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 java.lang.String POSTCONDITION_CALL_PREFIX
           
static java.lang.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 java.lang.String S_CONTROLS
           
static java.lang.String S_DUMP_FILE
           
static java.lang.String S_FULL_STATS_MACRO
           
static java.lang.String s_static_suffix
           
static java.lang.String S_TEXT_STATS_MACRO
           
static int SET_ASSERTIONS
           
static int SET_HOOKS
           
static int SET_PUBLIC
           
 
Constructor Summary
IOR()
           
 
Method Summary
static java.lang.String classToInterfacePtr(Class cls, Extendable e, java.lang.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, java.lang.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 generateArgumentList(LanguageWriterForC writer, Context context, java.lang.String self, boolean is_interface, SymbolID id, Method method, boolean in_signature, boolean add_type, boolean obj_ptr, java.lang.String exc_var, boolean do_return, boolean do_indices, boolean do_rarrays, boolean isExec)
          Generate the method's argument list.
static void generateArguments(LanguageWriterForC writer, Context context, java.lang.String self, java.util.List args, boolean isStatic, boolean doThrows, Type returnType, boolean addType, boolean objPtr, boolean doRaw, boolean deref_inout)
          Generate the specified argument list.
static void generateArguments(LanguageWriterForC writer, Context context, java.lang.String self, java.util.List args, boolean isStatic, java.lang.String excVar, Type returnType, boolean addType, boolean objPtr, boolean doRaw, boolean deref_inout, boolean isExec)
          Generate the specified argument list.
static void generateCastFunction(Class cls, java.lang.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 java.lang.String getArgumentString(Argument arg, Context context)
          Generate an argument string for the specified SIDL argument.
static java.lang.String getArgumentString(Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec)
          Generate a C argument string for the specified SIDL argument.
static java.lang.String getArgumentString(Method method, Context context)
          Generate a string containing only the specified method's arguments, including exceptions, if any.
static java.lang.String getArgumentWithFormal(Argument arg, Context context)
          Generate an argument string with the formal argument name.
static java.lang.String getArgumentWithFormal(Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec)
          Generate a C argument string with the formal argument name.
static java.lang.String getArrayName(int intType)
          Get the sidl array name for a given type.
static java.lang.String getArrayName(SymbolID id)
          Convert a SIDL symbol into its array representation, which is "struct " followed by the symbol name followed by "__array".
static java.lang.String getArrayNameForFunctions(int intType)
          Gets the sidl array name for a given type, for use in C functions.
static java.lang.String getArrayNameWithoutAsterix(int intType)
          Gets the sidl array name for a given type, and removes the trailing asterix.
static java.lang.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 java.lang.String getBuiltinName(int index)
          Return the normal name of the builtin method.
static java.lang.String getBuiltinName(int index, boolean sVersion)
          Return the name of the specified version of the builtin method.
static java.lang.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 java.lang.String getCast(Method method, java.lang.String self, Context context)
          Generate a cast string for the specified method.
static java.lang.String getClassType()
          Return the name of the type of the implicit base class type.
static java.lang.String getControlsStruct(SymbolID id)
          Convert a SIDL symbol into its control structure.
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 getEnumValueSymbol(SymbolID id, java.lang.String value)
          Return the enum value symbol for a particular enum type and string.
static java.lang.String getEPVName(SymbolID id)
          Convert a SIDL symbol into its method entry point vector (EPV) name.
static java.lang.String getEPVPrefix(int epvType)
          Return the static EPV prefix string or, if invalid, the one with the minimum type value.
static java.lang.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 java.lang.String getEPVVar(int type)
          Return the standard method entry point vector (EPV) variable.
static java.lang.String getExceptionFundamentalType()
          Return the name of the type of the implicit exception argument; namely, sidl_BaseInterface__object.
static java.lang.String getExternalFunc(SymbolID id)
          Get the name of the function that returns the structure of external entry points.
static java.lang.String getExternalName(SymbolID id)
          Get struct name for extern entry point structure.
static java.lang.String getExternalVariableName(SymbolID id)
          Get struct name for extern entry point variable.
static java.util.Set getFCastSymbolIDs(Extendable ext)
          Returns a Set containing all the Symbol IDs that need FCast methods generated for them in this Extendable.
static java.util.Set getFConnectSymbolIDs(Extendable ext)
          Returns a Set containing all the Symbol IDs that need FConnect methods generated for them in this Extendable.
static java.lang.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 java.lang.String getGetEPVsName(SymbolID id)
          Convert a SIDL symbol into its method that returns initialized epv pointers.
static java.lang.String getHaveLockStaticGlobalsMacroName()
          A CPP macro name
static java.lang.String getHeaderFile(SymbolID id)
          Generate the header filename associated with a symbol identifier.
static java.lang.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 java.lang.String getInitialValue(Type type)
          Gives an initial value based on the type of the argument
static java.lang.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 java.lang.String getInterfaceType()
          Return the name of the type of the base interface type.
static java.lang.String getInvariantExceptType()
           
static java.lang.String getLocalStaticsName(SymbolID id)
          Convert a SIDL symbol into the name of its associated local statics method.
static java.lang.String getLockStaticGlobalsMacroName()
          A CPP Macro Name
static java.lang.String getMethodControlsStruct(SymbolID id)
          Convert a SIDL symbol into its method control structure.
static java.lang.String getMethodDescDataName(SymbolID id)
          Return the name of the static variable associated with the method description data.
static java.lang.String getMethodDescDataStruct(SymbolID id)
          Return the name of the method description data structure name.
static java.lang.String getMethodIndex(SymbolID id, Method meth)
          Return the method index constant name associated with the specified method.
static java.lang.String getMethodIndex(SymbolID id, java.lang.String lit)
          Return the method index constant name associated with the specified literal.
static java.lang.String getMethodName(SymbolID id, java.lang.String name)
          Returns the name of the built-in method, prepending "ior_" and the name of the symbol.
static java.lang.String getNewName(SymbolID id)
          Convert a SIDL symbol into the name of its associated constructor, which is the symbol name appended with "__new".
static java.lang.String getObjectName(java.lang.String fqn)
          Convert a SIDL interface or class into its symbol name, which is "struct " followed by the symbol name followed by "__object".
static java.lang.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 java.lang.String getPostconditionExceptType()
           
static java.lang.String getPostEPVName(SymbolID id)
          Convert a SIDL symbol into its Post hooks method entry point vector (EPV) name.
static java.lang.String getPostSEPVName(SymbolID id)
          Convert a SIDL symbol into its post hooks static entry point vector (SEPV) name.
static java.lang.String getPreconditionExceptType()
           
static java.lang.String getPreEPVName(SymbolID id)
          Convert a SIDL symbol into its Pre hooks method entry point vector (EPV) name.
static java.lang.String getPreSEPVName(SymbolID id)
          Convert a SIDL symbol into its pre hooks static entry point vector (SEPV) name.
static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getReturnString(Type type, Context context)
          Generate a return string for the specified SIDL type.
static java.lang.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 java.lang.String getSEPVName(SymbolID id)
          Convert a SIDL symbol into its static entry point vector (SEPV) name.
static java.lang.String getSetEPVName(SymbolID id)
          Convert a SIDL symbol into the name of its set EPV method.
static java.lang.String getSetEPVTypeName(int type)
          Returns the name of the set EPV type.
static java.lang.String getSetSEPVName(SymbolID id)
          Convert a SIDL symbol into the name of its set static EPV method.
static java.lang.String getSkelFCastName(SymbolID sourceid, SymbolID targetid)
          Convert a SIDL symbol into the name of its associated remote connector.
static java.lang.String getSkelFConnectName(SymbolID sourceid, SymbolID targetid)
          Convert a SIDL symbol into the name of its associated remote connector.
static java.lang.String getSkelSerializationName(SymbolID extid, SymbolID structid, boolean serialize)
           
static java.lang.String getSourceFile(SymbolID id)
          Generate the source filename associated with a symbol identifier.
static java.lang.String getStaticEPVVariable(SymbolID id, int epvType, int setType)
          Return the name of the specified static EPV variable.
static java.lang.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 java.lang.String getStaticTypeOption(SymbolID id, int type)
          Return the static epv type option name.
static java.lang.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 java.util.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 java.lang.String getSymbolName(java.lang.String name)
          Convert a symbol name into an IOR identifier.
static java.lang.String getSymbolName(SymbolID id)
          Convert a symbol name into an IOR identifier.
static java.lang.String getSymbolType(Symbol sym)
           
static java.lang.String getUnlockStaticGlobalsMacroName()
          A CPP macro name
static java.lang.String getVectorEntry(java.lang.String methodName)
          Generate the name of an entry in the entry point vector or the static entry point vector.
static java.lang.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(java.lang.String methodName)
          Return TRUE if the method name is one of the non-static built-in methods, FALSE otherwise.
static boolean isBuiltinMethod(java.lang.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, java.util.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAJOR_VERSION

public static final int MAJOR_VERSION
See Also:
Constant Field Values

MINOR_VERSION

public static final int MINOR_VERSION
See Also:
Constant Field Values

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.

See Also:
getBuiltinMethod(int, gov.llnl.babel.symbols.SymbolID, gov.llnl.babel.Context, boolean), Constant Field Values

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.

See Also:
Constant Field Values

CAST

public static final int CAST
The index of the builtin method for casting.

See Also:
Constant Field Values

DELETE

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

See Also:
Constant Field Values

EXEC

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

See Also:
Constant Field Values

GETURL

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

See Also:
Constant Field Values

RADDREF

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

See Also:
Constant Field Values

ISREMOTE

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

See Also:
Constant Field Values

HOOKS

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

See Also:
Constant Field Values

CONSTRUCTOR

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

See Also:
Constant Field Values

CONSTRUCTOR2

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

See Also:
Constant Field Values

DESTRUCTOR

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

See Also:
Constant Field Values

LOAD

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

See Also:
Constant Field Values

CHECKS

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

See Also:
Constant Field Values

CHECK_ERROR

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

See Also:
Constant Field Values

DUMP_STATS

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

See Also:
Constant Field Values

FUND_EXCEPTION_CALL_PREFIX

public static java.lang.String FUND_EXCEPTION_CALL_PREFIX

PRECONDITION_CALL_PREFIX

public static java.lang.String PRECONDITION_CALL_PREFIX

POSTCONDITION_CALL_PREFIX

public static java.lang.String POSTCONDITION_CALL_PREFIX

INVARIANT_CALL_PREFIX

public static java.lang.String INVARIANT_CALL_PREFIX

PUBLIC_EPV

public static final int PUBLIC_EPV
See Also:
Constant Field Values

BASE_EPV

public static final int BASE_EPV
See Also:
Constant Field Values

SET_PUBLIC

public static final int SET_PUBLIC
See Also:
Constant Field Values

SET_ASSERTIONS

public static final int SET_ASSERTIONS
See Also:
Constant Field Values

SET_HOOKS

public static final int SET_HOOKS
See Also:
Constant Field Values

EPV_NEW

public static final int EPV_NEW
See Also:
Constant Field Values

EPV_OLD

public static final int EPV_OLD
See Also:
Constant Field Values

EPV_REMOTE

public static final int EPV_REMOTE
See Also:
Constant Field Values

EPV_STATIC

public static final int EPV_STATIC
See Also:
Constant Field Values

EPV_ARG

public static final int EPV_ARG
See Also:
Constant Field Values

GENERIC_PRE_SUFFIX

public static final java.lang.String GENERIC_PRE_SUFFIX
See Also:
Constant Field Values

GENERIC_POST_SUFFIX

public static final java.lang.String GENERIC_POST_SUFFIX
See Also:
Constant Field Values

GENERIC_SUFFIX_MAXLEN

public static final int GENERIC_SUFFIX_MAXLEN
See Also:
Constant Field Values

D_CALLS

public static final java.lang.String D_CALLS
See Also:
Constant Field Values

D_CHECKS

public static final java.lang.String D_CHECKS
See Also:
Constant Field Values

D_CONTROLS

public static final java.lang.String D_CONTROLS
See Also:
Constant Field Values

D_COUNTDOWN

public static final java.lang.String D_COUNTDOWN
See Also:
Constant Field Values

D_DATA

public static final java.lang.String D_DATA
See Also:
Constant Field Values

D_HOOKS

public static final java.lang.String D_HOOKS
See Also:
Constant Field Values

D_METHOD_CONTROLS

public static final java.lang.String D_METHOD_CONTROLS
See Also:
Constant Field Values

D_METHOD_EXCEPT

public static final java.lang.String D_METHOD_EXCEPT
See Also:
Constant Field Values

D_SUCCESSES

public static final java.lang.String D_SUCCESSES
See Also:
Constant Field Values

D_RATE

public static final java.lang.String D_RATE
See Also:
Constant Field Values

D_TRIES

public static final java.lang.String D_TRIES
See Also:
Constant Field Values

S_CONTROLS

public static final java.lang.String S_CONTROLS
See Also:
Constant Field Values

S_DUMP_FILE

public static final java.lang.String S_DUMP_FILE
See Also:
Constant Field Values

DEFAULT_CHECK_LEVEL

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

See Also:
Constant Field Values

DEFAULT_OPTION_HOOKS

public static final java.lang.String DEFAULT_OPTION_HOOKS
See Also:
Constant Field Values

DEFAULT_THRESHOLD

public static final java.lang.String DEFAULT_THRESHOLD
See Also:
Constant Field Values

S_FULL_STATS_MACRO

public static final java.lang.String S_FULL_STATS_MACRO
See Also:
Constant Field Values

S_TEXT_STATS_MACRO

public static final java.lang.String S_TEXT_STATS_MACRO
See Also:
Constant Field Values

s_static_suffix

public static final java.lang.String s_static_suffix
See Also:
Constant Field Values
Constructor Detail

IOR

public IOR()
Method Detail

getLockStaticGlobalsMacroName

public static java.lang.String getLockStaticGlobalsMacroName()
A CPP Macro Name


getUnlockStaticGlobalsMacroName

public static java.lang.String getUnlockStaticGlobalsMacroName()
A CPP macro name


getHaveLockStaticGlobalsMacroName

public static java.lang.String getHaveLockStaticGlobalsMacroName()
A CPP macro name


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.
Throws:
java.lang.ArrayIndexOutOfBoundsException - this runtime exception is thrown if index is out of bounds.
CodeGenerationException

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.
Throws:
java.lang.ArrayIndexOutOfBoundsException - this runtime exception is thrown if index is out of bounds.
CodeGenerationException

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.

getBuiltinName

public static java.lang.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.
Throws:
java.lang.ArrayIndexOutOfBoundsException - this runtime exception is thrown if index is out of bounds.

getBuiltinComment

public static java.lang.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.
Throws:
java.lang.ArrayIndexOutOfBoundsException - this runtime exception is thrown if index is out of bounds.

getBuiltinName

public static java.lang.String getBuiltinName(int index)
Return the normal name of the builtin method.

Parameters:
index - the index of the desired builtin method.
Throws:
java.lang.ArrayIndexOutOfBoundsException - this runtime exception is thrown if index is out of bounds.

isBuiltinMethod

public static boolean isBuiltinMethod(java.lang.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.

isBuiltinMethod

public static boolean isBuiltinMethod(java.lang.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

isBuiltinBasic

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


isBuiltinAssert

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


getVectorEntry

public static java.lang.String getVectorEntry(java.lang.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.

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


getSourceFile

public static java.lang.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".


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.


getSymbolName

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


getMethodName

public static java.lang.String getMethodName(SymbolID id,
                                             java.lang.String name)
Returns the name of the built-in method, prepending "ior_" and the name 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".


getEnumValueSymbol

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


getExternalName

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


getExternalVariableName

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


getExternalFunc

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


getObjectName

public static java.lang.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".


getObjectName

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


getStructName

public static java.lang.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".


getRemoteStructName

public static java.lang.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".


getArrayName

public static java.lang.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 java.lang.String getArrayName(int intType)
Get the sidl array name for a given type. Use the arrayType from the array.


getArrayNameWithoutAsterix

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


getArrayNameForFunctions

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


isSIDLSymbol

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


supportAssertions

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

Throws:
CodeGenerationException

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.


supportBaseEPVAttr

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

Throws:
CodeGenerationException

getMethodDescDataStruct

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


getMethodDescDataName

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


getControlsStruct

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


getMethodControlsStruct

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


getEPVName

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


getGetEPVsName

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


getSEPVName

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


getPreEPVName

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


getPreSEPVName

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


getPostEPVName

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


getPostSEPVName

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


getEPVType

public static java.lang.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 java.lang.String getEPVVar(int type)
Return the standard method entry point vector (EPV) variable.


getSetEPVTypeName

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


getNewName

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


getRemoteName

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


getRemoteConnectName

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


getRemoteCastName

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


getRemoteGetURLName

public static java.lang.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 java.lang.String getRemoteIsRemoteName(SymbolID id)
Convert a SIDL symbol into the name of its associated getURL function, which is the symbol name appended with "__getURL".


getRaddRefName

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


getFConnectSymbolIDs

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

Throws:
CodeGenerationException

getFCastSymbolIDs

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

Throws:
CodeGenerationException

getStructSymbolIDs

public static java.util.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.

Throws:
CodeGenerationException

getSkelSerializationName

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

getSkelFConnectName

public static java.lang.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)


getSkelFCastName

public static java.lang.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)


getSetEPVName

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


getSetSEPVName

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


getEPVPrefix

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


getStaticEPVVariable

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


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.


getCallLoadName

public static java.lang.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"


getLocalStaticsName

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


getStaticsName

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


getInitName

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


getInitEPVName

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


getFiniName

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


getVersionName

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


getExceptionFundamentalType

public static java.lang.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.


getClassType

public static java.lang.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.


getInterfaceType

public static java.lang.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.


getPreconditionExceptType

public static java.lang.String getPreconditionExceptType()

getPostconditionExceptType

public static java.lang.String getPostconditionExceptType()

getInvariantExceptType

public static java.lang.String getInvariantExceptType()

getSymbolType

public static java.lang.String getSymbolType(Symbol sym)

getReturnString

public static java.lang.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.
Throws:
CodeGenerationException

getInitialValue

public static java.lang.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.
Throws:
CodeGenerationException

getReturnString

public static java.lang.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.
Throws:
CodeGenerationException

getArgumentString

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

Throws:
CodeGenerationException

getArgumentString

public static java.lang.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.
Throws:
CodeGenerationException

getArgumentString

public static java.lang.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
Throws:
CodeGenerationException

getArgumentWithFormal

public static java.lang.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.
Throws:
CodeGenerationException

getArgumentWithFormal

public static java.lang.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
Throws:
CodeGenerationException

getCast

public static java.lang.String getCast(Method method,
                                       java.lang.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.

Throws:
CodeGenerationException

getStaticTypeOption

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


getMethodIndex

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


getMethodIndex

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


getRuntimeException

public static SymbolID getRuntimeException(Context context)

getRuntimeExceptionSymbol

public static Symbol getRuntimeExceptionSymbol(Context context)

generateCastFunction

public static void generateCastFunction(Class cls,
                                        java.lang.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.

Throws:
CodeGenerationException

classToInterfacePtr

public static java.lang.String classToInterfacePtr(Class cls,
                                                   Extendable e,
                                                   java.lang.String self)
                                            throws CodeGenerationException
Generate an expression to obtain a pointer to an interface or subclass from an object pointer.

Parameters:
self - this string holds the name to the object pointer that the interface/subclass pointer will be obtained from
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
Returns:
a String containing the expression to cast & (if necessary) dereference the self pointer to the appropriate internal data structure
Throws:
CodeGenerationException

resolveRenamedMethods

public static void resolveRenamedMethods(Extendable ext,
                                         java.util.HashMap renames)

declareEPVsAsArgs

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

isUnserializable

public static boolean isUnserializable(Context context,
                                       Type t)

isUnserializable

public static boolean isUnserializable(Context context,
                                       Struct strct)

generateArgumentList

public static void generateArgumentList(LanguageWriterForC writer,
                                        Context context,
                                        java.lang.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.

generateArgumentList

public static void generateArgumentList(LanguageWriterForC writer,
                                        Context context,
                                        java.lang.String self,
                                        boolean is_interface,
                                        SymbolID id,
                                        Method method,
                                        boolean in_signature,
                                        boolean add_type,
                                        boolean obj_ptr,
                                        java.lang.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.

generateArguments

public static void generateArguments(LanguageWriterForC writer,
                                     Context context,
                                     java.lang.String self,
                                     java.util.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.

generateArguments

public static void generateArguments(LanguageWriterForC writer,
                                     Context context,
                                     java.lang.String self,
                                     java.util.List args,
                                     boolean isStatic,
                                     java.lang.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.