gov.llnl.babel.backend.cxx
Class CxxStubHeader

java.lang.Object
  extended bygov.llnl.babel.backend.cxx.CxxStubHeader

public class CxxStubHeader
extends java.lang.Object


Field Summary
static int DUMP_STATS
          Indices associated with the special, stub-only built-in methods.
static int SET_CHECKING
           
static int SET_HOOKS
           
 
Constructor Summary
CxxStubHeader(Extendable ext)
          Create an object capable of generating the header file for a BABEL extendable.
CxxStubHeader(Extendable ext, LanguageWriterForCxx writer)
          Special constructor for generating super methods for IMPL files.
 
Method Summary
static void generateBuiltinSignature(LanguageWriterForCxx lw, int type, SymbolID id, boolean doStatic, java.lang.String terminator)
          Generate the specified stub-only built-in method signature.
 void generateCode()
          Generate the header file for the extendable with which this object was created.
static void generateSupers(Class cls, LanguageWriterForCxx writer)
          This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files.
static java.lang.String getBuiltinArgList(int type)
          Return the comma-separated list of arguments associated with the specified built-in method.
static java.lang.String getBuiltinComment(int type, boolean doStatic)
          Return the comment description associated with the specified built-in stub.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMP_STATS

public static final int DUMP_STATS
Indices associated with the special, stub-only built-in methods.

See Also:
Constant Field Values

SET_CHECKING

public static final int SET_CHECKING
See Also:
Constant Field Values

SET_HOOKS

public static final int SET_HOOKS
See Also:
Constant Field Values
Constructor Detail

CxxStubHeader

public CxxStubHeader(Extendable ext)
Create an object capable of generating the header file for a BABEL extendable.

Parameters:
ext - an interface or class symbol that needs a header file for a Cxx C extension class.

CxxStubHeader

public CxxStubHeader(Extendable ext,
                     LanguageWriterForCxx writer)
Special constructor for generating super methods for IMPL files. Since these can only exist for classes, d_self is just "self"

Parameters:
ext - an interface or class symbol that needs a header file for a Cxx C extension class.
Method Detail

generateSupers

public static void generateSupers(Class cls,
                                  LanguageWriterForCxx writer)
                           throws CodeGenerationException
This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files. The output stream is not closed on exit. A code generation exception is thrown if an error is detected.

Parameters:
writer - the output writer to which the stub source will be written. This will not be closed.
cls - The class in which these supers are to be generated
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

generateCode

public void generateCode()
                  throws CodeGenerationException
Generate the header file for the extendable with which this object was created.

Throws:
CodeGenerationException - this is a catch all exception for problems during the code generation phase.

getBuiltinComment

public static java.lang.String getBuiltinComment(int type,
                                                 boolean doStatic)
Return the comment description associated with the specified built-in stub.


generateBuiltinSignature

public static void generateBuiltinSignature(LanguageWriterForCxx lw,
                                            int type,
                                            SymbolID id,
                                            boolean doStatic,
                                            java.lang.String terminator)
Generate the specified stub-only built-in method signature.


getBuiltinArgList

public static java.lang.String getBuiltinArgList(int type)
Return the comma-separated list of arguments associated with the specified built-in method. The entries must match the names and ordering found (above) in generateStubBuiltinSignature().