ptolemy.copernicus.c
Class HeaderFileGenerator

java.lang.Object
  extended by ptolemy.copernicus.c.CodeGenerator
      extended by ptolemy.copernicus.c.HeaderFileGenerator

public class HeaderFileGenerator
extends CodeGenerator

A C code generator for generating "header files" (.h files) that implement Java classes.

Since:
Ptolemy II 2.0
Version:
$Id: HeaderFileGenerator.java,v 1.53 2007/12/06 18:28:39 cxh Exp $
Author:
Shuvra S. Bhattacharyya, Ankush Varma
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (ssb)

Field Summary
 
Fields inherited from class ptolemy.copernicus.c.CodeGenerator
_context, _requiredTypeMap
 
Constructor Summary
HeaderFileGenerator()
          Construct a header file generator.
 
Method Summary
protected  java.lang.String _generateIncludeDirectives()
          Override method in CodeFileGenerator and include directives for "interface header" files instead of .h files.
 java.lang.String generate(soot.SootClass source)
          Generate code for a C header file that implements declarations associated with a class.
 
Methods inherited from class ptolemy.copernicus.c.CodeGenerator
_comment, _generateArrayInstanceDeclarations, _generateMethodHeader, _generateParameterTypeList, _getRequiredIncludeFiles, _indent, _removeRequiredType, _updateRequiredTypes, _warn, setSingleClassMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderFileGenerator

public HeaderFileGenerator()
Construct a header file generator.

Method Detail

generate

public java.lang.String generate(soot.SootClass source)
Generate code for a C header file that implements declarations associated with a class. Code for two struct-based type definitions is generated here. One type corresponds to the class itself (class variables, function pointers to methods, etc.), and the other type is for instances of the class.

Specified by:
generate in class CodeGenerator
Parameters:
source - The class.
Returns:
Header code for the class.

_generateIncludeDirectives

protected java.lang.String _generateIncludeDirectives()
Override method in CodeFileGenerator and include directives for "interface header" files instead of .h files.

Overrides:
_generateIncludeDirectives in class CodeGenerator
Returns:
The generated include directives.