2015-08-27 11:36:14 +00:00
|
|
|
package bcelifier;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.nio.file.OpenOption;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
|
2015-09-02 15:11:32 +00:00
|
|
|
import org.apache.commons.bcel6.classfile.ClassFormatException;
|
|
|
|
import org.apache.commons.bcel6.classfile.ClassParser;
|
|
|
|
import org.apache.commons.bcel6.classfile.JavaClass;
|
|
|
|
import org.apache.commons.bcel6.util.BCELifier;
|
2015-08-27 11:36:14 +00:00
|
|
|
|
|
|
|
public class JavaToBCEL {
|
|
|
|
|
|
|
|
public final static String rootDirectory = System.getProperty("user.dir")+"/BCEL/bcelifier/";
|
|
|
|
|
|
|
|
public static void main(String args[]){
|
|
|
|
new JavaToBCEL();
|
|
|
|
}
|
|
|
|
|
|
|
|
public JavaToBCEL(){
|
|
|
|
try {
|
2015-10-31 17:48:46 +00:00
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"Lambda1.class").parse(), new FileOutputStream(new File(rootDirectory+"Lambda1Creator.java"))).start();
|
2016-04-26 13:52:22 +00:00
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"This.class").parse(), new FileOutputStream(new File(rootDirectory+"ThisCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"IntLiteral.class").parse(), new FileOutputStream(new File(rootDirectory+"IntLiteralCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"MethodCall.class").parse(), new FileOutputStream(new File(rootDirectory+"MethodCallCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"FieldDeclaration.class").parse(), new FileOutputStream(new File(rootDirectory+"FieldDeclarationCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"Null.class").parse(), new FileOutputStream(new File(rootDirectory+"NullCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"LocalVarAccess.class").parse(), new FileOutputStream(new File(rootDirectory+"LocalVarAccessCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"Wildcard.class").parse(), new FileOutputStream(new File(rootDirectory+"WildcardCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"BooleanValue.class").parse(), new FileOutputStream(new File(rootDirectory+"BooleanValueCreator.java"))).start();
|
|
|
|
//new BCELifier(new ClassParser(rootDirectory+"NewClass.class").parse(), new FileOutputStream(new File(rootDirectory+"NewClassCreator.java"))).start();
|
|
|
|
new BCELifier(new ClassParser(rootDirectory+"IfStatement.class").parse(), new FileOutputStream(new File(rootDirectory+"IfStatementCreator.java"))).start();
|
2015-08-27 11:36:14 +00:00
|
|
|
} catch (ClassFormatException | IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|