|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dellroad.jc.cgen.SootCodeGenerator
JC's default source file generator. This class generates C code by first analyzing class files using the Soot framework, and then converting byte code into C statements using the various other helper classes in this package.
Constructor Summary | |
SootCodeGenerator(SourceLocator sourceLocator,
MethodOptimizer optimizer,
boolean includeLineNumbers)
Instantiate. |
Method Summary | |
void |
genC(String className,
OutputStream output)
Generate the C source file for the class using the Soot framework. |
void |
generateC(String className,
ClassfileFinder finder,
OutputStream output)
Wrapper for genC() that handles properly
configuring Soot to find class files. |
void |
generateH(String className,
ClassfileFinder finder,
OutputStream output)
Wrapper for genH() that handles properly
configuring Soot to find class files. |
void |
genH(String className,
OutputStream output)
Generate the C header file for the class using the Soot framework. |
void |
reset()
Reset Soot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SootCodeGenerator(SourceLocator sourceLocator, MethodOptimizer optimizer, boolean includeLineNumbers)
sourceLocator
- How Soot should retrieve class files,
or null
in which case the finder
parameter to generateC()
and
generateH()
must be an instance of
SearchpathFinder
.optimizer
- Object for optimizing method bodies, or
null
to use the default.Method Detail |
public void reset()
reset
in interface CodeGenerator
public final void generateH(String className, ClassfileFinder finder, OutputStream output) throws Exception
genH()
that handles properly
configuring Soot to find class files.
generateH
in interface CodeGenerator
className
- name of the class who's header file we're generatingfinder
- a way to acquire Java class filesoutput
- where to write the generated header file to
Exception
public final void generateC(String className, ClassfileFinder finder, OutputStream output) throws Exception
genC()
that handles properly
configuring Soot to find class files.
generateC
in interface CodeGenerator
className
- name of the class who's C file we're generatingfinder
- a way to acquire Java class filesoutput
- where to write the generated C file to
Exception
public void genH(String className, OutputStream output) throws Exception
generateH()
.
className
- Class name with dots instead of slashes
Exception
public void genC(String className, OutputStream output) throws Exception
generateC()
.
className
- Class name with dots instead of slashes
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |