|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.backend.matlab.Matlab
public class Matlab
This class defines some of the fundamental mapping rules for translating a symbol in the sidl file into Python. These fundamental mapping rules are used repeatedly in the generation of client and server side bindings, so they are seperated into a class that can be shared by all Python code generators.
Some of the particular features include:
Constructor Summary | |
---|---|
Matlab()
|
Method Summary | |
---|---|
static void |
addInclude(LanguageWriterForC writer,
java.lang.String filename,
boolean useGuard)
|
static java.lang.String |
allocateStringSpace(java.lang.String s_strSize)
Generate a string which allocate space a character array. |
static java.lang.String |
argComment(Argument arg)
Create a comment to describe the SIDL type for the C signature. |
static java.lang.String |
checkMxClass(Type argType,
java.lang.String mxName,
int i,
boolean isStatic)
Generate a string which checks if a matrix has the proper class to match the argument type in SIDL specification. |
static LanguageWriterForC |
createStub(Symbol symbol,
java.lang.String description,
Context context)
Generate an IO stream to receive the C stub file for the Matlab clients. |
static void |
generateCArgumentList(LanguageWriterForC writer,
Context context,
java.lang.String self,
SymbolID id,
Method method,
boolean addType,
boolean isStatic)
|
static void |
generateMatArgumentList(java.lang.String self,
LanguageWriterForMatlab writer,
SymbolID id,
Method method)
Generate the argument list for Matlab method function. |
static java.lang.String |
generatePlhsMatrix(Type t,
int idx,
java.lang.String varName)
Generate a string which creates a Mx matrix for the given Matlab data type. |
static java.lang.String |
getClientMatFile(SymbolID id)
Generate the Matlab filename for the client using the specified symbol identifier. |
static java.lang.String |
getConstructorStubFile(SymbolID id)
|
static java.lang.String |
getConstructorStubName(SymbolID id)
|
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 |
getHeaderFile(SymbolID id)
|
static java.lang.String |
getMethodStubFile(SymbolID id,
Method method)
|
static java.lang.String |
getMxType(java.lang.String sidlType)
Generate an return string for the Matlab type mapping to the specific SIDL Type. |
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 |
getReturnType(Method method,
Context context)
Generate a return string for the specified IOR type. |
static java.lang.String |
getSidlReturnType(Method method)
Generate a return string for the specified SIDL type. |
static java.lang.String |
getSymbolName(SymbolID id)
Generate the symbol name using the specified * symbol identifier. |
static java.lang.String |
sourceFilename(Symbol symbol,
java.lang.String modifier)
Return a string for the JNI native type corresponding to the specified Java type. |
static void |
StubHeaderFiles(LanguageWriterForC writer)
Generate an include file for a symbol. |
static void |
StubNullDefine(LanguageWriterForC writer)
|
static void |
writeMexFunctionSignature(LanguageWriterForC writer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matlab()
Method Detail |
---|
public static java.lang.String getSymbolName(SymbolID id)
public static java.lang.String getHeaderFile(SymbolID id)
public static java.lang.String getClientMatFile(SymbolID id)
public static java.lang.String getConstructorStubName(SymbolID id)
public static java.lang.String getConstructorStubFile(SymbolID id)
public 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 getMethodStubFile(SymbolID id, Method method)
public static void writeMexFunctionSignature(LanguageWriterForC writer)
public static java.lang.String getObjectName(SymbolID id)
id
- the SymbolID
of the Symbol
.public static void generateMatArgumentList(java.lang.String self, LanguageWriterForMatlab writer, SymbolID id, Method method) throws CodeGenerationException
CodeGenerationException
public static void generateCArgumentList(LanguageWriterForC writer, Context context, java.lang.String self, SymbolID id, Method method, boolean addType, boolean isStatic) throws CodeGenerationException
CodeGenerationException
public static java.lang.String argComment(Argument arg)
arg
- the argument to make a comment from
public static java.lang.String getReturnType(Method method, Context context) throws CodeGenerationException
CodeGenerationException
public static java.lang.String getSidlReturnType(Method method)
public static java.lang.String getMxType(java.lang.String sidlType)
public static java.lang.String allocateStringSpace(java.lang.String s_strSize)
public static java.lang.String checkMxClass(Type argType, java.lang.String mxName, int i, boolean isStatic)
public static java.lang.String generatePlhsMatrix(Type t, int idx, java.lang.String varName)
public static void StubHeaderFiles(LanguageWriterForC writer)
public static void addInclude(LanguageWriterForC writer, java.lang.String filename, boolean useGuard)
public static void StubNullDefine(LanguageWriterForC writer)
public static java.lang.String sourceFilename(Symbol symbol, java.lang.String modifier)
public static LanguageWriterForC createStub(Symbol symbol, java.lang.String description, Context context) throws CodeGenerationException
CodeGenerationException
- this is a catch all exception for problems during the code
generation phase.
Currently: setJavaStylePackageGeneration is set to false,
need set to true later and does some work on adding new
matpath automatically for each created stub directory named after
sidl package name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |