ptolemy.copernicus.c
Class MainFileGenerator

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

public class MainFileGenerator
extends CodeGenerator

A C code generator for generating the c file containing the wrapper "main" method. This simply does some initialization and calls the main method of the appropriate class, if such a method exists.

Since:
Ptolemy II 2.0
Version:
$Id: MainFileGenerator.java,v 1.31 2006/03/28 23:58:34 cxh Exp $
Author:
Ankush Varma
Accepted Rating:
Red (ankush)
Proposed Rating:
Red (ankush)

Field Summary
 
Fields inherited from class ptolemy.copernicus.c.CodeGenerator
_context, _requiredTypeMap
 
Constructor Summary
MainFileGenerator()
          Default constructor.
 
Method Summary
 java.lang.String generate(soot.SootClass source)
          Generate the code for the wrapper "main" C function that calls the main method of the appropriate class.
 
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

MainFileGenerator

public MainFileGenerator()
Default constructor.

Method Detail

generate

public java.lang.String generate(soot.SootClass source)
Generate the code for the wrapper "main" C function that calls the main method of the appropriate class. It also generates other functions required for correct initialization.

Specified by:
generate in class CodeGenerator
Parameters:
source - The main class.
Returns:
The code for the wrapper main() C function.