Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Decompiler Class Reference

List of all members.

Public Methods

 Decompiler (Hashtable cls, AnnotationManager am, String path, String suffix)
 Decompiler (Hashtable cls, AnnotationManager am, String path, String suffix, TypeTable tt)
void decompile ()
Hashtable getLineToAnnotationTable ()

Static Public Methods

void addImports (String cls)

Static Public Attributes

String fileSuffix = ".java"

Private Methods

void dump (SootClass sc)
String printImports ()
void renumber (Hashtable tbl, int offset)

Private Attributes

Hashtable classes = null
String outputPath = "."
String outFilename = ""
DecompilerPrinter src = new DecompilerPrinter()
int lineCounter
Hashtable lineToAnnotation = new Hashtable()

Static Private Attributes

AnnotationManager annot = null
Vector imports = new Vector()
TypeTable typeTable = null

Detailed Description

Decompiler package is basically the main semi-decompiler class. All components of Bandera works on Jimple-level, which format resembles the Java byte-code. Sometimes, it is preferable to make the intermediate results, like after slicing or abstraction available for user view. This is the need of Decompiler package. Moreover, we definitely need the decompiler in order to use JPF module checker since JPF input is in Java.

Why it is called a semi-decompiler? It is because of the usage of annotations in decompiling the codes. The annotation created by the compiler, JJJC, is used extensively to retrieve variable names and all sort of things so that we don't need to deal directly with the Jimple, which makes things a lot simpler.

Note that if you inspect this code, you'll see that this solution is somewhat patchy. Yes, it is because other component may inline and do some optimizing stuffs (and probably some other non-reversible actions) to the code. So, there is no way that I can cover all cases (like jumping into an if block). This is it, don't complain. If you don't like it, don't use it.

If you're interested on how the decompiler are used in Bandera, you should only resort in Decompiler class, decompile method, in particular.

Author:
Roby Joehanes
Version:
0.4.21

Definition at line 71 of file Decompiler.java.


Constructor & Destructor Documentation

Decompiler::Decompiler Hashtable   cls,
AnnotationManager   am,
String   path,
String   suffix
[inline]
 

You need to supply the hashtable of compiled classes, the annotation manager, output path, and file suffix (usually ".java").

The usage is something like this:
Slabs decompiler = new Slabs(classes, annotMgr, "/usr/pub/mydir", ".java");
then:
decompiler.decompile();
You're done. Currently LineNumberToAnnotation is not implemented yet.

Definition at line 92 of file Decompiler.java.


Member Function Documentation

void Decompiler::addImports String   cls [inline, static]
 

This is meant to add some import statements in order to resemble the original. This feature is probably added whenever I have some time.

Definition at line 113 of file Decompiler.java.

Referenced by decompile().

void Decompiler::decompile   [inline]
 

Decompiles all the classes. See constructor's notes

Definition at line 124 of file Decompiler.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:08:44 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001