ptolemy.copernicus.c
Class CodeFileGenerator

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

public class CodeFileGenerator
extends CodeGenerator

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

Since:
Ptolemy II 2.0
Version:
$Id: CodeFileGenerator.java,v 1.56 2007/12/06 18:28:35 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
CodeFileGenerator()
          Construct a code file generator.
 
Method Summary
protected  java.lang.StringBuffer _declareConstants()
          Generate declarations for constants in the generated code.
 java.lang.String generate(soot.SootClass source)
          Generate C code for a class, including code (function declarations) for all of its methods, and for its initialization function.
 
Methods inherited from class ptolemy.copernicus.c.CodeGenerator
_comment, _generateArrayInstanceDeclarations, _generateIncludeDirectives, _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

CodeFileGenerator

public CodeFileGenerator()
Construct a code file generator.

Method Detail

generate

public java.lang.String generate(soot.SootClass source)
Generate C code for a class, including code (function declarations) for all of its methods, and for its initialization function.

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

_declareConstants

protected java.lang.StringBuffer _declareConstants()
Generate declarations for constants in the generated code.

Returns:
The generated declarations for constants.