gov.llnl.babel.backend.c
Class ImplHeader

java.lang.Object
  |
  +--gov.llnl.babel.backend.c.ImplHeader

public class ImplHeader
extends java.lang.Object

Class ImplHeader generates a C implementation header to a language writer output stream. The constructor takes a language writer stream and method generateCode generates the implementation header file for the specified symbol to the output stream. The language writer stream is not closed by this object.


Constructor Summary
ImplHeader(LanguageWriterForC writer, CodeSplicer splicer)
          Create a ImplHeader object that will write symbol information to the provided output language writer stream.
 
Method Summary
 void generateCode(Class cls)
          Write C implementation header information for the provided class to the language writer output stream provided in the constructor.
static void generateCode(Class cls, LanguageWriterForC writer, CodeSplicer splicer)
          This is a convenience utility function that writes the symbol header information into the provided language writer output stream.
 java.util.Collection getLocalReferences(Extendable ext)
           
static void writeBuiltinDecls(LanguageWriter lw, Class cls)
          Write external declarations for the Class constructor and destructor.
static void writeMethodDecls(LanguageWriter lw, Class cls, boolean isStatic)
          Write external declarations for all non-abstract methods in the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplHeader

public ImplHeader(LanguageWriterForC writer,
                  CodeSplicer splicer)
Create a ImplHeader object that will write symbol information to the provided output language writer stream. Assumption: This code is completed generated so no code splicer capabilities are needed.

Parameters:
writer - the output writer for the new implementation header file. This writer will not be closed by this method.
Method Detail

generateCode

public static void generateCode(Class cls,
                                LanguageWriterForC writer,
                                CodeSplicer splicer)
                         throws CodeGenerationException
This is a convenience utility function that writes the symbol header information into the provided language writer output stream. The output stream is not closed on exit.

Parameters:
cls - the Class whose implementation header file is to be created.
writer - the output writer with which the new header file is created.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

writeMethodDecls

public static void writeMethodDecls(LanguageWriter lw,
                                    Class cls,
                                    boolean isStatic)
                             throws CodeGenerationException
Write external declarations for all non-abstract methods in the class.

Parameters:
lw - the language writer to write to.
cls - the Class whose header will be written.
isStatic - true means write only static methods; false means write only non-static methods.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

writeBuiltinDecls

public static void writeBuiltinDecls(LanguageWriter lw,
                                     Class cls)
                              throws CodeGenerationException
Write external declarations for the Class constructor and destructor.

Parameters:
lw - the language writer to write to.
cls - the Class whose header will be written.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.

getLocalReferences

public java.util.Collection getLocalReferences(Extendable ext)

generateCode

public void generateCode(Class cls)
                  throws CodeGenerationException
Write C implementation header information for the provided class to the language writer output stream provided in the constructor. This method does not close the writer output stream.

Parameters:
cls - the Class whose header will be written.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.