|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.backend.c.C
public class C
Class C
contains common C language binding routines
shared by the C backend code generators. This class simply collects
many common C binding routines into one place.
Field Summary | |
---|---|
static java.lang.String |
FUNCTION_RESULT
|
static java.lang.String |
NULL
|
static java.lang.String |
RAW_ARRAY_EXT
|
Constructor Summary | |
---|---|
C()
|
Method Summary | |
---|---|
static java.lang.String |
argComment(Argument arg)
Create a comment to describe the SIDL type for the C signature. |
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)
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)
Generate the specified argument list. |
static java.lang.String |
getArgumentWithFormal(Argument arg,
Context context,
boolean objPtr,
boolean inStub,
boolean isExec)
|
static java.lang.String |
getDataGetName(SymbolID id)
Convert a symbol name into its private data structure get access function name. |
static java.lang.String |
getDataName(SymbolID id)
Convert a symbol name into its private data structure identifier. |
static java.lang.String |
getDataSetName(SymbolID id)
Convert a symbol name into its private data structure set access function name. |
static java.lang.String |
getDelRefArray(Type arrayType)
|
static java.lang.String |
getEnsureArray(Type arrayType)
|
static java.lang.String |
getEnumName(SymbolID id)
Convert a SIDL enumerated type into its symbol name, which is "enum " followed by the symbol name followed by "__enum". |
static java.lang.String |
getExceptionType()
|
static java.lang.String |
getFullMethodName(SymbolID id,
Method method)
Generate the full method name associated with the symbol id and the specified method. |
static java.lang.String |
getFullMethodName(SymbolID id,
java.lang.String methodName)
Generate the full method name associated with the symbol id and the specified method. |
static java.lang.String |
getFullSelfDecl(SymbolID id)
Return the full self declaration (i.e., the type and standard self variable. |
static java.lang.String |
getHeaderFile(SymbolID id)
Generate the header filename associated with a symbol identifier. |
static java.lang.String |
getImplFCastName(SymbolID sourceid,
SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector. |
static java.lang.String |
getImplFConnectName(SymbolID sourceid,
SymbolID targetid)
Convert a SIDL symbol into the name of its associated remote connector. |
static java.lang.String |
getImplFGetURLName(SymbolID sourceid,
SymbolID targetid)
Convert a SIDL symbol into the name of its associated get URL function. |
static java.lang.String |
getImplHeaderFile(SymbolID id)
Generate the implementation header filename associated with a symbol identifier. |
static java.lang.String |
getImplSourceFile(SymbolID id)
Generate the implementation source filename associated with a symbol identifier. |
static int |
getLongestNameLen(Struct strct)
Calculate the maximum name length of struct items. |
static java.lang.String |
getMethodImplName(SymbolID id,
java.lang.String methodName)
Generate the impl method's name. |
static java.lang.String |
getMethodSkelName(SymbolID id,
Method method)
Generate the skel method's name. |
static java.lang.String |
getObjectName(SymbolID id)
Convert a SIDL symbol name into its object name -- for the purposes of this package that means convert it into its typedef object name. |
static java.lang.String |
getObjectStructName(SymbolID id)
Convert a SIDL symbol name into its object structure name. |
static java.lang.String |
getPrivateDestructor(SymbolID id)
Convert a symbol name into its private destructor function name provided by the SkelSource. |
static java.lang.String |
getReturnString(Type type,
Context context,
boolean objPtr,
boolean inStub)
|
static java.lang.String |
getSetEPVName(SymbolID id)
Convert a SIDL symbol into the name of its associated set EPV method, which is the symbol name appended with "__set_epv". |
static java.lang.String |
getSetSEPVName(SymbolID id)
Convert a SIDL symbol into the name of its associated set static EPV method, which is the symbol name appended with "__set_sepv". |
static Method |
getSExecMethod(Context context)
Creates a Method that represents the static Exec method |
static java.lang.String |
getSkelFile(SymbolID id)
Generate the skeleton filename associated with a symbol identifier. |
static java.lang.String |
getStubFile(SymbolID id)
Generate the stub filename associated with a symbol identifier. |
static java.lang.String |
getSymbolName(SymbolID id)
Convert a symbol name into an IOR identifier. |
static java.lang.String |
getSymbolObjectPtr(SymbolID id)
Convert a symbol name into an IOR type pointer. |
static boolean |
methodNeedsSkel(Method method)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FUNCTION_RESULT
public static final java.lang.String NULL
public static final java.lang.String RAW_ARRAY_EXT
Constructor Detail |
---|
public C()
Method Detail |
---|
public static java.lang.String getFullSelfDecl(SymbolID id)
public static java.lang.String getHeaderFile(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getStubFile(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getSkelFile(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getImplHeaderFile(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getImplSourceFile(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getDataName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getDataGetName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getDataSetName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getPrivateDestructor(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getSymbolObjectPtr(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getSymbolName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getEnumName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getObjectName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getObjectStructName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static int getLongestNameLen(Struct strct)
public static java.lang.String getSetEPVName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getImplFConnectName(SymbolID sourceid, SymbolID targetid)
public static java.lang.String getImplFCastName(SymbolID sourceid, SymbolID targetid)
public static java.lang.String getImplFGetURLName(SymbolID sourceid, SymbolID targetid)
public static java.lang.String getSetSEPVName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static java.lang.String getMethodImplName(SymbolID id, java.lang.String methodName)
id
- the SymbolID
of the Symbol
associated with the method.methodName
- the String
version of the name of the
method whose impl name is being built.public static boolean methodNeedsSkel(Method method)
public static java.lang.String getMethodSkelName(SymbolID id, Method method)
id
- the SymbolID
of the Symbol
associated with the method.method
- the methodpublic static java.lang.String getFullMethodName(SymbolID id, Method method)
id
- the SymbolID
of the Symbol
associated with the method.method
- the Method
whose full name is being built.public static java.lang.String getFullMethodName(SymbolID id, java.lang.String methodName)
id
- the SymbolID
of the Symbol
associated with the method.methodName
- the String
version of the name of the
method whose full name is being built.public static java.lang.String getEnsureArray(Type arrayType)
public static java.lang.String getDelRefArray(Type arrayType)
public static java.lang.String getExceptionType()
public static Method getSExecMethod(Context context) throws CodeGenerationException
CodeGenerationException
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
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.
CodeGenerationException
- this is a catch all exception. It can be caused by I/O trouble or
violations of the data type invariants.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) throws CodeGenerationException
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.
CodeGenerationException
- this is a catch all exception. It can be caused by I/O trouble or
violations of the data type invariants.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
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)
CodeGenerationException
- this is a catch all exception. It can be caused by I/O trouble or
violations of the data type invariants.public static java.lang.String argComment(Argument arg)
arg
- the argument to make a comment from
public static java.lang.String getReturnString(Type type, Context context, boolean objPtr, boolean inStub) throws CodeGenerationException
CodeGenerationException
public static java.lang.String getArgumentWithFormal(Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec) throws CodeGenerationException
CodeGenerationException
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) throws CodeGenerationException
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)
CodeGenerationException
- this is a catch all exception. It can be caused by I/O trouble or
violations of the data type invariants.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |