org.dellroad.jc.cgen
Class CFile

java.lang.Object
  extended byorg.dellroad.jc.cgen.SourceFile
      extended byorg.dellroad.jc.cgen.CFile
All Implemented Interfaces:
Constants

public class CFile
extends SourceFile

Represents a C source file being constructed from a Java class file.


Field Summary
static String includeStringName
           
 
Fields inherited from class org.dellroad.jc.cgen.SourceFile
c, cname, constructors, hasStaticInitializer, innerClasses, numVirtualRefFields, out, outerClass, prefix, sourceFile, staticFields, staticMethods, superclasses, virtualFields, virtualMethods
 
Fields inherited from interface org.dellroad.jc.cgen.Constants
IMETHOD_HASHSIZE, INSTANCEOF_HASHSIZE
 
Constructor Summary
CFile(SootClass c, Writer out, MethodOptimizer optimizer, boolean includeLineNumbers)
           
 
Method Summary
protected  void addDependencies(Set set, SootMethod m)
          Add all SootClasses to set that are referenced by the method signature, throws clause, locals, traps, or body instructions.
protected  void addDependency(Set set, Type t)
          Add to set the SootClass associated with Type t, if any.
 ConstantValueTag getInitialValue(SootField f)
           
 void output()
          Output the C source file.
 void outputClassInfo()
           
 void outputDepedencyList()
           
 void outputField(SootField f)
           
 void outputFieldList(SootField[] fields, String comment, String label)
           
 void outputFields()
           
 void outputInitialStuff()
           
 void outputInitialValue(SootField f, ConstantValueTag cvTag)
           
 void outputInnerClases()
           
 void outputInstanceOfHashTable()
           
 void outputInterfaceHashTable()
           
 void outputInterfaceList()
           
 void outputInterfaceQuickTable()
           
 void outputMethod(SootMethod m)
           
 void outputMethodList(SootMethod[] methods, String comment, String label)
           
 void outputMethods(SootMethod[] list)
           
 void outputStaticFieldStructure()
           
 void outputVtable()
           
protected  void prepareDependencies()
          Add dependencies on all classes that could, if changed, require this class's JC source file to be regenerated and/or recompiled.
 
Methods inherited from class org.dellroad.jc.cgen.SourceFile
include, include, outputBanner, outputCommentLine, outputFinalStuff, outputInitialStuff, spaceFillTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includeStringName

public static final String includeStringName
See Also:
Constant Field Values
Constructor Detail

CFile

public CFile(SootClass c,
             Writer out,
             MethodOptimizer optimizer,
             boolean includeLineNumbers)
Method Detail

output

public void output()
Output the C source file.

Specified by:
output in class SourceFile

prepareDependencies

protected void prepareDependencies()
Add dependencies on all classes that could, if changed, require this class's JC source file to be regenerated and/or recompiled. This includes headers where any structures we use are defined.


addDependency

protected void addDependency(Set set,
                             Type t)
Add to set the SootClass associated with Type t, if any.


addDependencies

protected void addDependencies(Set set,
                               SootMethod m)
Add all SootClasses to set that are referenced by the method signature, throws clause, locals, traps, or body instructions.


outputInitialStuff

public void outputInitialStuff()

outputFields

public void outputFields()

outputField

public void outputField(SootField f)

getInitialValue

public ConstantValueTag getInitialValue(SootField f)

outputInitialValue

public void outputInitialValue(SootField f,
                               ConstantValueTag cvTag)

outputStaticFieldStructure

public void outputStaticFieldStructure()

outputMethods

public void outputMethods(SootMethod[] list)

outputMethod

public void outputMethod(SootMethod m)

outputFieldList

public void outputFieldList(SootField[] fields,
                            String comment,
                            String label)

outputMethodList

public void outputMethodList(SootMethod[] methods,
                             String comment,
                             String label)

outputInterfaceList

public void outputInterfaceList()

outputInterfaceHashTable

public void outputInterfaceHashTable()

outputInterfaceQuickTable

public void outputInterfaceQuickTable()

outputVtable

public void outputVtable()

outputInstanceOfHashTable

public void outputInstanceOfHashTable()

outputInnerClases

public void outputInnerClases()

outputDepedencyList

public void outputDepedencyList()

outputClassInfo

public void outputClassInfo()