org.dellroad.jc.cgen
Interface CodeGenerator

All Known Implementing Classes:
SootCodeGenerator

public interface CodeGenerator

Interface for objects that can generate C source code and header files that conform to the JC C source file standard.


Method Summary
 void generateC(String className, ClassfileFinder finder, OutputStream output)
          Generate the C source file for the given class.
 void generateH(String className, ClassfileFinder finder, OutputStream output)
          Generate the C header file for the given class.
 void reset()
          Reset state.
 

Method Detail

generateH

public void generateH(String className,
                      ClassfileFinder finder,
                      OutputStream output)
               throws Exception
Generate the C header file for the given class.

Parameters:
className - name of the class who's header file we're generating
finder - a way to acquire Java class files
output - where to write the generated header file to
Throws:
Exception

generateC

public void generateC(String className,
                      ClassfileFinder finder,
                      OutputStream output)
               throws Exception
Generate the C source file for the given class.

Parameters:
className - name of the class who's C file we're generating
finder - a way to acquire Java class files
output - where to write the generated C file to
Throws:
Exception

reset

public void reset()
Reset state.

Currently only one CodeGenerator instance will be in use at a time. Before and after each use, this method is invoked. A good oportunity to free objects that are no longer needed, (re)initialize state, etc.