forked from JavaTX/JavaCompilerCore
Einführen von BCEL 6.1
This commit is contained in:
parent
5aebc06337
commit
25329cd39e
@ -3,7 +3,7 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="test"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="lib" path="lib/commons-bcel6-6.0-SNAPSHOT.jar" sourcepath="/home/janulrich/Development/intellijworkspace/bcel/src/main"/>
|
||||
<classpathentry kind="lib" path="lib/bcel-6.1-SNAPSHOT.jar" sourcepath="lib/bcel-6.1-SNAPSHOT-sources.jar"/>
|
||||
<classpathentry kind="lib" path="lib/guava-10.0.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
@ -8,16 +8,16 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.BootstrapMethod;
|
||||
import org.apache.commons.bcel6.classfile.BootstrapMethods;
|
||||
import org.apache.commons.bcel6.classfile.ConstantPool;
|
||||
import org.apache.commons.bcel6.classfile.InnerClass;
|
||||
import org.apache.commons.bcel6.classfile.InnerClasses;
|
||||
import org.apache.commons.bcel6.classfile.JavaClass;
|
||||
import org.apache.commons.bcel6.classfile.Method;
|
||||
import org.apache.commons.bcel6.classfile.Signature;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.classfile.BootstrapMethod;
|
||||
import org.apache.bcel.classfile.BootstrapMethods;
|
||||
import org.apache.bcel.classfile.ConstantPool;
|
||||
import org.apache.bcel.classfile.InnerClass;
|
||||
import org.apache.bcel.classfile.InnerClasses;
|
||||
import org.apache.bcel.classfile.JavaClass;
|
||||
import org.apache.bcel.classfile.Method;
|
||||
import org.apache.bcel.classfile.Signature;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
@ -62,7 +62,7 @@ public class ClassGenerator extends ClassGen{
|
||||
* @param toTPH
|
||||
* @return Es gilt dann "toTPH extends Type"
|
||||
*/
|
||||
public org.apache.commons.bcel6.generic.Type getNearestUsedType(Type t, Menge<TypePlaceholder> usedTypes){
|
||||
public org.apache.bcel.generic.Type getNearestUsedType(Type t, Menge<TypePlaceholder> usedTypes){
|
||||
if(t == null){
|
||||
return this.getInstructionFactory().createObjectType();
|
||||
}else if(t instanceof TypePlaceholder){ //Es muss sich in diesem Fall um einen TPH handeln:
|
||||
@ -72,7 +72,7 @@ public class ClassGenerator extends ClassGen{
|
||||
return t.getBytecodeType(this, getTypeinferenceResults().getTypeReconstructions().get(0));
|
||||
}
|
||||
}
|
||||
public org.apache.commons.bcel6.generic.Type getNearestUsedType(TypePlaceholder toTPH){
|
||||
public org.apache.bcel.generic.Type getNearestUsedType(TypePlaceholder toTPH){
|
||||
return this.getNearestUsedType(toTPH, null);
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,10 @@ package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.Constant;
|
||||
import org.apache.commons.bcel6.classfile.ConstantMethodHandle;
|
||||
import org.apache.commons.bcel6.classfile.ConstantMethodType;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.classfile.Constant;
|
||||
import org.apache.bcel.classfile.ConstantMethodHandle;
|
||||
import org.apache.bcel.classfile.ConstantMethodType;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
|
||||
public class DHBWConstantPoolGen extends ConstantPoolGen{
|
||||
private static final long serialVersionUID = -8282768548793548585L;
|
||||
|
@ -5,23 +5,23 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.classfile.Attribute;
|
||||
import org.apache.commons.bcel6.classfile.BootstrapMethod;
|
||||
import org.apache.commons.bcel6.classfile.ConstantInvokeDynamic;
|
||||
import org.apache.commons.bcel6.classfile.ConstantMethodHandle;
|
||||
import org.apache.commons.bcel6.classfile.ConstantMethodType;
|
||||
import org.apache.commons.bcel6.classfile.InnerClass;
|
||||
import org.apache.commons.bcel6.classfile.Method;
|
||||
import org.apache.commons.bcel6.classfile.Signature;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.INVOKEDYNAMIC;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LocalVariableInstruction;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.commons.bcel6.generic.Type;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.classfile.Attribute;
|
||||
import org.apache.bcel.classfile.BootstrapMethod;
|
||||
import org.apache.bcel.classfile.ConstantInvokeDynamic;
|
||||
import org.apache.bcel.classfile.ConstantMethodHandle;
|
||||
import org.apache.bcel.classfile.ConstantMethodType;
|
||||
import org.apache.bcel.classfile.InnerClass;
|
||||
import org.apache.bcel.classfile.Method;
|
||||
import org.apache.bcel.classfile.Signature;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.INVOKEDYNAMIC;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LocalVariableInstruction;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
import org.apache.bcel.generic.Type;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
@ -140,7 +140,7 @@ public class DHBWInstructionFactory extends InstructionFactory{
|
||||
}
|
||||
|
||||
public static Type createObjectType() {
|
||||
return new org.apache.commons.bcel6.generic.ObjectType("java.lang.Object");
|
||||
return new org.apache.bcel.generic.ObjectType("java.lang.Object");
|
||||
}
|
||||
|
||||
public Attribute createSignatureAttribute(String signature) {
|
||||
|
@ -8,25 +8,25 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.Attribute;
|
||||
import org.apache.commons.bcel6.classfile.ConstantPool;
|
||||
import org.apache.commons.bcel6.classfile.ConstantUtf8;
|
||||
import org.apache.commons.bcel6.classfile.Method;
|
||||
import org.apache.commons.bcel6.classfile.Signature;
|
||||
import org.apache.commons.bcel6.classfile.StackMap;
|
||||
import org.apache.commons.bcel6.classfile.StackMapEntry;
|
||||
import org.apache.commons.bcel6.classfile.Visitor;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.Instruction;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LocalVariableInstruction;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.commons.bcel6.generic.StackMapTableGen;
|
||||
import org.apache.commons.bcel6.generic.Type;
|
||||
import org.apache.bcel.classfile.Attribute;
|
||||
import org.apache.bcel.classfile.ConstantPool;
|
||||
import org.apache.bcel.classfile.ConstantUtf8;
|
||||
import org.apache.bcel.classfile.Method;
|
||||
import org.apache.bcel.classfile.Signature;
|
||||
import org.apache.bcel.classfile.StackMap;
|
||||
import org.apache.bcel.classfile.StackMapEntry;
|
||||
import org.apache.bcel.classfile.Visitor;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.Instruction;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LocalVariableInstruction;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
import org.apache.bcel.generic.StackMapTableGen;
|
||||
import org.apache.bcel.generic.Type;
|
||||
|
||||
import org.apache.commons.bcel6.Const;
|
||||
import org.apache.bcel.Const;
|
||||
|
||||
import de.dhbwstuttgart.logger.Logger;
|
||||
import de.dhbwstuttgart.logger.Section;
|
||||
@ -62,11 +62,11 @@ public class MethodGenerator extends MethodGen{
|
||||
il.append(blockInstructions);//Die vom Block generierten Instructions an die InstructionList der Methode anfügen
|
||||
//Ein return Statement anfügen, falls nicht vorhanden:
|
||||
//TODO: Das ist schlecht! Der Parser oder der Typinferenzalgorithmus muss dafür sorgen, dass sich in jeder Methode ein Return befindet.
|
||||
if (block.get_Statement().size() == 0) { il.append(factory.createReturn( org.apache.commons.bcel6.generic.Type.VOID)); }
|
||||
if (block.get_Statement().size() == 0) { il.append(factory.createReturn( org.apache.bcel.generic.Type.VOID)); }
|
||||
else {
|
||||
if (!(block.get_Statement().lastElement() instanceof Return) &&
|
||||
this.getType().equals(org.apache.commons.bcel6.generic.Type.VOID)) {
|
||||
il.append(factory.createReturn( org.apache.commons.bcel6.generic.Type.VOID));
|
||||
this.getType().equals(org.apache.bcel.generic.Type.VOID)) {
|
||||
il.append(factory.createReturn( org.apache.bcel.generic.Type.VOID));
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,11 +93,11 @@ public class MethodGenerator extends MethodGen{
|
||||
return method.getMethod();
|
||||
}
|
||||
|
||||
public LocalVariableInstruction createLoad(org.apache.commons.bcel6.generic.Type bytecodeType, String variableName) {
|
||||
public LocalVariableInstruction createLoad(org.apache.bcel.generic.Type bytecodeType, String variableName) {
|
||||
return InstructionFactory.createLoad(bytecodeType, getStoreIndex(variableName));
|
||||
}
|
||||
|
||||
public LocalVariableInstruction createStore(org.apache.commons.bcel6.generic.Type bytecodeType, String variableName) {
|
||||
public LocalVariableInstruction createStore(org.apache.bcel.generic.Type bytecodeType, String variableName) {
|
||||
return InstructionFactory.createStore(bytecodeType, getStoreIndex(variableName));
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ReferenceType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ReferenceType;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.classfile.Utility;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.commons.bcel6.generic.ReferenceType;
|
||||
import org.apache.commons.bcel6.generic.Type;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.classfile.Utility;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
import org.apache.bcel.generic.ReferenceType;
|
||||
import org.apache.bcel.generic.Type;
|
||||
|
||||
public class WildcardType extends ReferenceType{
|
||||
|
||||
|
@ -12,12 +12,12 @@ import java.util.List;
|
||||
|
||||
import javax.lang.model.element.Modifier;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
|
||||
import de.dhbwstuttgart.logger.Logger;
|
||||
import de.dhbwstuttgart.logger.Section;
|
||||
@ -51,9 +51,9 @@ import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
|
||||
|
||||
import org.apache.commons.bcel6.generic.*;
|
||||
import org.apache.commons.bcel6.classfile.*;
|
||||
import org.apache.commons.bcel6.*;
|
||||
import org.apache.bcel.generic.*;
|
||||
import org.apache.bcel.classfile.*;
|
||||
import org.apache.bcel.*;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.classfile.ConstantPool;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.classfile.ConstantPool;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import org.apache.commons.bcel6.generic.FieldGen;
|
||||
import org.apache.commons.bcel6.generic.FieldInstruction;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.commons.bcel6.Const;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.bcel.generic.FieldGen;
|
||||
import org.apache.bcel.generic.FieldInstruction;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
import org.apache.bcel.Const;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -9,14 +9,14 @@ import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.classfile.Signature;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.classfile.Signature;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.typeinference.Menge.Equal;
|
||||
@ -409,7 +409,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
||||
DHBWConstantPoolGen _cp = cg.getConstantPool();
|
||||
InstructionList il = new InstructionList();
|
||||
|
||||
ArrayList<org.apache.commons.bcel6.generic.Type> argumentTypes = new ArrayList<org.apache.commons.bcel6.generic.Type>();
|
||||
ArrayList<org.apache.bcel.generic.Type> argumentTypes = new ArrayList<org.apache.bcel.generic.Type>();
|
||||
ArrayList<String> argumentNames = new ArrayList<String>();
|
||||
|
||||
if(this.parameterlist != null && this.parameterlist.size() > 0){
|
||||
@ -421,14 +421,14 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
||||
|
||||
Type returnType = this.getType();
|
||||
|
||||
MethodGenerator method = new MethodGenerator(constants, returnType.getBytecodeType(cg, t), argumentTypes.toArray(new org.apache.commons.bcel6.generic.Type[parameterlist.size()]) , argumentNames.toArray(new String[parameterlist.size()]), this.get_Method_Name(), getParentClass().name, il, _cp);
|
||||
MethodGenerator method = new MethodGenerator(constants, returnType.getBytecodeType(cg, t), argumentTypes.toArray(new org.apache.bcel.generic.Type[parameterlist.size()]) , argumentNames.toArray(new String[parameterlist.size()]), this.get_Method_Name(), getParentClass().name, il, _cp);
|
||||
|
||||
cg.setMethodeGenerator(method);
|
||||
|
||||
cg.addMethod(method.createMethod(cg, getParameterList(), returnType, get_Block(), t));
|
||||
}
|
||||
|
||||
private void generateArgumentList(ArrayList<org.apache.commons.bcel6.generic.Type> argumentTypes, ArrayList<String> argumentNames, ClassGenerator cg, TypeinferenceResultSet t) {
|
||||
private void generateArgumentList(ArrayList<org.apache.bcel.generic.Type> argumentTypes, ArrayList<String> argumentNames, ClassGenerator cg, TypeinferenceResultSet t) {
|
||||
for(FormalParameter parameter : this.parameterlist){
|
||||
argumentTypes.add(parameter.getType().getBytecodeType(cg, t));
|
||||
argumentNames.add(parameter.getIdentifier());
|
||||
|
@ -146,8 +146,8 @@ public class ParameterList extends SyntaxTreeNode implements Iterable<FormalPara
|
||||
return this.formalparameter.size();
|
||||
}
|
||||
|
||||
public org.apache.commons.bcel6.generic.Type[] getBytecodeTypeList(ClassGenerator cg, TypeinferenceResultSet rs){
|
||||
org.apache.commons.bcel6.generic.Type[] ret = new org.apache.commons.bcel6.generic.Type[formalparameter.size()];
|
||||
public org.apache.bcel.generic.Type[] getBytecodeTypeList(ClassGenerator cg, TypeinferenceResultSet rs){
|
||||
org.apache.bcel.generic.Type[] ret = new org.apache.bcel.generic.Type[formalparameter.size()];
|
||||
int i = 0;
|
||||
for(FormalParameter f : formalparameter){
|
||||
ret[i] = f.getType().getBytecodeType(cg, rs);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -6,13 +6,13 @@ import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.DUP;
|
||||
import org.apache.commons.bcel6.generic.IADD;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.InvokeInstruction;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.DUP;
|
||||
import org.apache.bcel.generic.IADD;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.InvokeInstruction;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -98,18 +98,18 @@ public abstract class AddOp extends Operator
|
||||
InstructionList il = new InstructionList();
|
||||
il.append(_factory.createNew("java.lang.StringBuilder"));
|
||||
il.append(new DUP());
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "<init>", org.apache.commons.bcel6.generic.Type.VOID, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKESPECIAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "<init>", org.apache.bcel.generic.Type.VOID, new org.apache.bcel.generic.Type[] {}, Constants.INVOKESPECIAL));
|
||||
|
||||
il.append(operator.get_Expr1().genByteCode(_cg, rs));
|
||||
|
||||
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "append", objectType, new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.STRING}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "append", objectType, new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.STRING}, Constants.INVOKEVIRTUAL));
|
||||
|
||||
il.append(operator.get_Expr2().genByteCode(_cg, rs));
|
||||
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "append", objectType, new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.STRING}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "append", objectType, new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.STRING}, Constants.INVOKEVIRTUAL));
|
||||
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "toString", new ObjectType("java.lang.String"), new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.StringBuilder", "toString", new ObjectType("java.lang.String"), new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
|
||||
return il;
|
||||
}else{
|
||||
@ -146,13 +146,13 @@ public abstract class AddOp extends Operator
|
||||
|
||||
private InvokeInstruction convertValueToObject(DHBWInstructionFactory _factory, String returnType) {
|
||||
if(returnType.equals("java.lang.Integer")){
|
||||
return _factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.INT}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.INT}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Double")){
|
||||
return _factory.createInvoke("java.lang.Double", "valueOf", new ObjectType("java.lang.Double"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.DOUBLE}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Double", "valueOf", new ObjectType("java.lang.Double"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.DOUBLE}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Float")){
|
||||
return _factory.createInvoke("java.lang.Float", "valueOf", new ObjectType("java.lang.Float"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.FLOAT}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Float", "valueOf", new ObjectType("java.lang.Float"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.FLOAT}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Long")){
|
||||
return _factory.createInvoke("java.lang.Long", "valueOf", new ObjectType("java.lang.Long"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.LONG}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Long", "valueOf", new ObjectType("java.lang.Long"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.LONG}, Constants.INVOKESTATIC);
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
|
@ -5,15 +5,15 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.DADD;
|
||||
import org.apache.commons.bcel6.generic.DDIV;
|
||||
import org.apache.commons.bcel6.generic.FADD;
|
||||
import org.apache.commons.bcel6.generic.FDIV;
|
||||
import org.apache.commons.bcel6.generic.IADD;
|
||||
import org.apache.commons.bcel6.generic.IDIV;
|
||||
import org.apache.commons.bcel6.generic.LADD;
|
||||
import org.apache.commons.bcel6.generic.LDIV;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.DADD;
|
||||
import org.apache.bcel.generic.DDIV;
|
||||
import org.apache.bcel.generic.FADD;
|
||||
import org.apache.bcel.generic.FDIV;
|
||||
import org.apache.bcel.generic.IADD;
|
||||
import org.apache.bcel.generic.IDIV;
|
||||
import org.apache.bcel.generic.LADD;
|
||||
import org.apache.bcel.generic.LDIV;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
|
@ -4,14 +4,14 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.module.EqualOp.8597.import
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPNE;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.NOP;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IF_ICMPNE;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.NOP;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,8 +4,8 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.module.GreaterEquOp.8598.import
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPLT;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.IF_ICMPLT;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
@ -4,8 +4,8 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.module.GreaterOp.8599.import
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPLE;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.IF_ICMPLE;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
||||
|
@ -4,8 +4,8 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.module.LessEquOp.8600.import
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPGT;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.IF_ICMPGT;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
||||
|
@ -3,8 +3,8 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.end
|
||||
// ino.module.LessOp.8601.import
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPGE;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.IF_ICMPGE;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
||||
|
@ -4,9 +4,9 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.module.MinusOp.8603.import
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.IADD;
|
||||
import org.apache.commons.bcel6.generic.ISUB;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.IADD;
|
||||
import org.apache.bcel.generic.ISUB;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package de.dhbwstuttgart.syntaxtree.operator;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.IREM;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.IREM;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
||||
|
@ -7,11 +7,11 @@ import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.InvokeInstruction;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.InvokeInstruction;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -109,13 +109,13 @@ public abstract class MulOp extends Operator
|
||||
|
||||
private InvokeInstruction convertValueToObject(DHBWInstructionFactory _factory, String returnType) {
|
||||
if(returnType.equals("java.lang.Integer")){
|
||||
return _factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.INT}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.INT}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Double")){
|
||||
return _factory.createInvoke("java.lang.Double", "valueOf", new ObjectType("java.lang.Double"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.DOUBLE}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Double", "valueOf", new ObjectType("java.lang.Double"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.DOUBLE}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Float")){
|
||||
return _factory.createInvoke("java.lang.Float", "valueOf", new ObjectType("java.lang.Float"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.FLOAT}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Float", "valueOf", new ObjectType("java.lang.Float"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.FLOAT}, Constants.INVOKESTATIC);
|
||||
}else if(returnType.equals("java.lang.Long")){
|
||||
return _factory.createInvoke("java.lang.Long", "valueOf", new ObjectType("java.lang.Long"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.LONG}, Constants.INVOKESTATIC);
|
||||
return _factory.createInvoke("java.lang.Long", "valueOf", new ObjectType("java.lang.Long"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.LONG}, Constants.INVOKESTATIC);
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import de.dhbwstuttgart.syntaxtree.statement.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.typeinference.Pair;
|
||||
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.IF_ACMPEQ;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.IF_ACMPEQ;
|
||||
|
||||
|
||||
// ino.class.NotEqualOp.24241.declaration
|
||||
|
@ -6,12 +6,12 @@ import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.DADD;
|
||||
import org.apache.commons.bcel6.generic.FADD;
|
||||
import org.apache.commons.bcel6.generic.IADD;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LADD;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.DADD;
|
||||
import org.apache.bcel.generic.FADD;
|
||||
import org.apache.bcel.generic.IADD;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LADD;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -85,17 +85,17 @@ public abstract class Operator extends SyntaxTreeNode
|
||||
InstructionList il = new InstructionList();
|
||||
il.append(operand.genByteCode(_cg, rs));
|
||||
if(returnType.equals("java.lang.Integer")){
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Integer", "intValue", org.apache.commons.bcel6.generic.Type.INT, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Integer", "intValue", org.apache.bcel.generic.Type.INT, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
}else if(returnType.equals("java.lang.Double")){
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Double", "doubleValue", org.apache.commons.bcel6.generic.Type.DOUBLE, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Double", "doubleValue", org.apache.bcel.generic.Type.DOUBLE, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
}else if(returnType.equals("java.lang.Float")){
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Float", "floatValue", org.apache.commons.bcel6.generic.Type.FLOAT, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Float", "floatValue", org.apache.bcel.generic.Type.FLOAT, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
}else if(returnType.equals("java.lang.Long")){
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Long", "longValue", org.apache.commons.bcel6.generic.Type.LONG, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Long", "longValue", org.apache.bcel.generic.Type.LONG, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
}else if(returnType.equals("java.lang.String")){
|
||||
throw new NotImplementedException(returnType);
|
||||
}else if(returnType.equals("java.lang.Boolean")){
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Boolean", "booleanValue", org.apache.commons.bcel6.generic.Type.BOOLEAN, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_cg.getInstructionFactory().createInvoke("java.lang.Boolean", "booleanValue", org.apache.bcel.generic.Type.BOOLEAN, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
}else{
|
||||
throw new NotImplementedException(returnType);
|
||||
}
|
||||
|
@ -2,14 +2,14 @@
|
||||
package de.dhbwstuttgart.syntaxtree.operator;
|
||||
// ino.end
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IFEQ;
|
||||
import org.apache.commons.bcel6.generic.IFNE;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IFEQ;
|
||||
import org.apache.bcel.generic.IFNE;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
import de.dhbwstuttgart.bytecode.DHBWInstructionFactory;
|
||||
@ -49,13 +49,13 @@ public class OrOp extends LogOp
|
||||
DHBWInstructionFactory _factory = _cg.getInstructionFactory();
|
||||
|
||||
InstructionList il = operator.get_Expr1().genByteCode(_cg, rs);
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.commons.bcel6.generic.Type.BOOLEAN, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.bcel.generic.Type.BOOLEAN, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
|
||||
BranchInstruction firstTest = new IFNE(null);
|
||||
il.append(firstTest);
|
||||
|
||||
il.append(operator.get_Expr2().genByteCode(_cg, rs));
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.commons.bcel6.generic.Type.BOOLEAN, new org.apache.commons.bcel6.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.bcel.generic.Type.BOOLEAN, new org.apache.bcel.generic.Type[] {}, Constants.INVOKEVIRTUAL));
|
||||
|
||||
BranchInstruction secondTest = new IFEQ(null);
|
||||
il.append(secondTest);
|
||||
@ -67,7 +67,7 @@ public class OrOp extends LogOp
|
||||
|
||||
secondTest.setTarget(il.append(InstructionConstants.ICONST_0));
|
||||
|
||||
gotoInstruction.setTarget(il.append(_factory.createInvoke("java.lang.Boolean", "valueOf", new ObjectType("java.lang.Boolean"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.BOOLEAN}, Constants.INVOKESTATIC)));
|
||||
gotoInstruction.setTarget(il.append(_factory.createInvoke("java.lang.Boolean", "valueOf", new ObjectType("java.lang.Boolean"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.BOOLEAN}, Constants.INVOKESTATIC)));
|
||||
|
||||
return il;
|
||||
}
|
||||
|
@ -6,20 +6,20 @@ import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.DADD;
|
||||
import org.apache.commons.bcel6.generic.FADD;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IADD;
|
||||
import org.apache.commons.bcel6.generic.IFEQ;
|
||||
import org.apache.commons.bcel6.generic.IFNE;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.InvokeInstruction;
|
||||
import org.apache.commons.bcel6.generic.LADD;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.DADD;
|
||||
import org.apache.bcel.generic.FADD;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IADD;
|
||||
import org.apache.bcel.generic.IFEQ;
|
||||
import org.apache.bcel.generic.IFNE;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.InvokeInstruction;
|
||||
import org.apache.bcel.generic.LADD;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
import de.dhbwstuttgart.bytecode.DHBWInstructionFactory;
|
||||
|
@ -7,12 +7,12 @@ import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -95,7 +95,7 @@ public abstract class RelOp extends Operator
|
||||
il.append(gotoInstruction);
|
||||
|
||||
operatorBranchInstruction.setTarget(il.append(InstructionConstants.ICONST_0));
|
||||
gotoInstruction.setTarget(il.append(_factory.createInvoke("java.lang.Boolean", "valueOf", new ObjectType("java.lang.Boolean"), new org.apache.commons.bcel6.generic.Type[] {org.apache.commons.bcel6.generic.Type.BOOLEAN}, Constants.INVOKESTATIC)));
|
||||
gotoInstruction.setTarget(il.append(_factory.createInvoke("java.lang.Boolean", "valueOf", new ObjectType("java.lang.Boolean"), new org.apache.bcel.generic.Type[] {org.apache.bcel.generic.Type.BOOLEAN}, Constants.INVOKESTATIC)));
|
||||
|
||||
return il;
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ package de.dhbwstuttgart.syntaxtree.operator;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ArithmeticInstruction;
|
||||
import org.apache.commons.bcel6.generic.DMUL;
|
||||
import org.apache.commons.bcel6.generic.FMUL;
|
||||
import org.apache.commons.bcel6.generic.IMUL;
|
||||
import org.apache.commons.bcel6.generic.LMUL;
|
||||
import org.apache.bcel.generic.ArithmeticInstruction;
|
||||
import org.apache.bcel.generic.DMUL;
|
||||
import org.apache.bcel.generic.FMUL;
|
||||
import org.apache.bcel.generic.IMUL;
|
||||
import org.apache.bcel.generic.LMUL;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
|
@ -2,7 +2,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -89,8 +89,8 @@ public class ArgumentList extends SyntaxTreeNode
|
||||
return ret;
|
||||
}
|
||||
|
||||
public org.apache.commons.bcel6.generic.Type[] getBytecodeTypeList(ClassGenerator cg, TypeinferenceResultSet rs){
|
||||
org.apache.commons.bcel6.generic.Type[] ret = new org.apache.commons.bcel6.generic.Type[expr.size()];
|
||||
public org.apache.bcel.generic.Type[] getBytecodeTypeList(ClassGenerator cg, TypeinferenceResultSet rs){
|
||||
org.apache.bcel.generic.Type[] ret = new org.apache.bcel.generic.Type[expr.size()];
|
||||
int i = 0;
|
||||
for(Expr e : expr){
|
||||
ret[i] = e.getType().getBytecodeType(cg, rs);
|
||||
|
@ -6,14 +6,14 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ASTORE;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.DSTORE;
|
||||
import org.apache.commons.bcel6.generic.FSTORE;
|
||||
import org.apache.commons.bcel6.generic.ISTORE;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LSTORE;
|
||||
import org.apache.bcel.generic.ASTORE;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.DSTORE;
|
||||
import org.apache.bcel.generic.FSTORE;
|
||||
import org.apache.bcel.generic.ISTORE;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LSTORE;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -6,13 +6,13 @@ import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPNE;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.NOP;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IF_ICMPNE;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.NOP;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -6,13 +6,13 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,10 +4,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.BoolLiteral.8626.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,10 +4,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.CharLiteral.8628.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BIPUSH;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.BIPUSH;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,13 +4,13 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.IntLiteral.8635.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BIPUSH;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LDC;
|
||||
import org.apache.commons.bcel6.generic.LDC2_W;
|
||||
import org.apache.bcel.generic.BIPUSH;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LDC;
|
||||
import org.apache.bcel.generic.LDC2_W;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,8 +4,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.EmptyStmt.8629.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
|
@ -4,11 +4,11 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.IntLiteral.8635.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LDC;
|
||||
import org.apache.commons.bcel6.generic.LDC2_W;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LDC;
|
||||
import org.apache.bcel.generic.LDC2_W;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,13 +4,13 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IF_ICMPGE;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.NOP;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IF_ICMPGE;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.NOP;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
@ -6,21 +6,21 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ALOAD;
|
||||
import org.apache.commons.bcel6.generic.ASTORE;
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.GotoInstruction;
|
||||
import org.apache.commons.bcel6.generic.IFEQ;
|
||||
import org.apache.commons.bcel6.generic.IFNONNULL;
|
||||
import org.apache.commons.bcel6.generic.IfInstruction;
|
||||
import org.apache.commons.bcel6.generic.Instruction;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.NOP;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ALOAD;
|
||||
import org.apache.bcel.generic.ASTORE;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.GotoInstruction;
|
||||
import org.apache.bcel.generic.IFEQ;
|
||||
import org.apache.bcel.generic.IFNONNULL;
|
||||
import org.apache.bcel.generic.IfInstruction;
|
||||
import org.apache.bcel.generic.Instruction;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.NOP;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -180,7 +180,7 @@ public class IfStmt extends Statement
|
||||
|
||||
il.append(expr.genByteCode(_cg, rs));
|
||||
//Anmerkung: expr ist vom Typ java.lang.Boolean (per Definition)
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.commons.bcel6.generic.Type.BOOLEAN, org.apache.commons.bcel6.generic.Type.NO_ARGS, Constants.INVOKEVIRTUAL));
|
||||
il.append(_factory.createInvoke("java.lang.Boolean", "booleanValue", org.apache.bcel.generic.Type.BOOLEAN, org.apache.bcel.generic.Type.NO_ARGS, Constants.INVOKEVIRTUAL));
|
||||
il.append(ifInstruction);
|
||||
il.append(then_block.genByteCode(_cg, rs));
|
||||
|
||||
|
@ -6,8 +6,8 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,14 +4,14 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.IntLiteral.8635.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.BIPUSH;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.commons.bcel6.generic.PUSH;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.BIPUSH;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
import org.apache.bcel.generic.PUSH;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -145,7 +145,7 @@ public class IntLiteral extends Literal
|
||||
* Der jetzige Compiler kann keine primitiven Typen. Ein int-Literal ist daher eine Instanz von java.lang.Integer
|
||||
*/
|
||||
il.append(new PUSH(cg.getConstantPool(), this.get_Int()));
|
||||
il.append(_factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.commons.bcel6.generic.Type[] { org.apache.commons.bcel6.generic.Type.INT }, Constants.INVOKESTATIC));
|
||||
il.append(_factory.createInvoke("java.lang.Integer", "valueOf", new ObjectType("java.lang.Integer"), new org.apache.bcel.generic.Type[] { org.apache.bcel.generic.Type.INT }, Constants.INVOKESTATIC));
|
||||
|
||||
return il;
|
||||
}
|
||||
|
@ -2,16 +2,16 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.Const;
|
||||
import org.apache.commons.bcel6.classfile.BootstrapMethod;
|
||||
import org.apache.commons.bcel6.classfile.ConstantPool;
|
||||
import org.apache.commons.bcel6.generic.BIPUSH;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.commons.bcel6.generic.INVOKEDYNAMIC;
|
||||
import org.apache.bcel.Const;
|
||||
import org.apache.bcel.classfile.BootstrapMethod;
|
||||
import org.apache.bcel.classfile.ConstantPool;
|
||||
import org.apache.bcel.generic.BIPUSH;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
import org.apache.bcel.generic.INVOKEDYNAMIC;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -213,8 +213,8 @@ public class LambdaExpression extends Expr{
|
||||
ConstantPoolGen cp = cg.getConstantPool();
|
||||
InstructionList il = new InstructionList();
|
||||
|
||||
org.apache.commons.bcel6.generic.Type[] paramTypes = params.getBytecodeTypeList(cg, rs);
|
||||
org.apache.commons.bcel6.generic.Type retType = method_body.getType().getBytecodeType(cg, rs);
|
||||
org.apache.bcel.generic.Type[] paramTypes = params.getBytecodeTypeList(cg, rs);
|
||||
org.apache.bcel.generic.Type retType = method_body.getType().getBytecodeType(cg, rs);
|
||||
|
||||
MethodGenerator lambdaMethod = new MethodGenerator(0, retType,
|
||||
paramTypes, params.getParameterNameArray(), cg.createLambdaMethodName(),
|
||||
@ -225,7 +225,7 @@ public class LambdaExpression extends Expr{
|
||||
lambdaMethod.setAccessFlags(Const.ACC_PRIVATE+Const.ACC_SYNTHETIC);
|
||||
|
||||
String interfaceMethodName = "apply"; //Das ist ein Hack, funktioniert momentan, da nur FunN Interfaces für LambdaAusdrücke funktionieren
|
||||
il.append(InstructionFactory.createLoad( org.apache.commons.bcel6.generic.Type.OBJECT, 0));
|
||||
il.append(InstructionFactory.createLoad( org.apache.bcel.generic.Type.OBJECT, 0));
|
||||
il.append(cg.getInstructionFactory().createInvokeDynamic(interfaceMethodName,this.getLambdaSignature(cg, rs),lambdaType,lambdaMethod, rs));
|
||||
|
||||
cg.addMethod(lambdaMethod.createMethod(cg, params, method_body.getType(), method_body, rs));
|
||||
|
@ -5,10 +5,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -161,7 +161,7 @@ public class LocalOrFieldVarOrClassname extends Expr
|
||||
}
|
||||
|
||||
Type type = this.getType();
|
||||
org.apache.commons.bcel6.generic.Type byteCodeType = type.getBytecodeType(cg, rs);
|
||||
org.apache.bcel.generic.Type byteCodeType = type.getBytecodeType(cg, rs);
|
||||
|
||||
String name = this.get_Name();
|
||||
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.logger.Logger;
|
||||
|
@ -4,10 +4,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.IntLiteral.8635.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LDC2_W;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LDC2_W;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,11 +4,11 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.MethodCall.8639.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -338,9 +338,9 @@ public class MethodCall extends Expr
|
||||
kind = Constants.INVOKEVIRTUAL;
|
||||
}
|
||||
|
||||
org.apache.commons.bcel6.generic.Type[] argumentTypen = org.apache.commons.bcel6.generic.Type.NO_ARGS;
|
||||
org.apache.bcel.generic.Type[] argumentTypen = org.apache.bcel.generic.Type.NO_ARGS;
|
||||
if(this.getArgumentList() != null && this.getArgumentList().size()>0){
|
||||
argumentTypen = new org.apache.commons.bcel6.generic.Type[this.getArgumentList().size()];
|
||||
argumentTypen = new org.apache.bcel.generic.Type[this.getArgumentList().size()];
|
||||
int i = 0;
|
||||
for(Expr argument : this.arglist.expr){
|
||||
cg.getMethodGenerator().getStoreIndex(argument.get_Name());
|
||||
@ -352,7 +352,7 @@ public class MethodCall extends Expr
|
||||
}
|
||||
}
|
||||
|
||||
org.apache.commons.bcel6.generic.Type returnType = this.getType().getBytecodeType(cg, rs);
|
||||
org.apache.bcel.generic.Type returnType = this.getType().getBytecodeType(cg, rs);
|
||||
il.append(_factory.createInvoke(receiver.getReceiverClass(cg, rs).getName().toString(), this.get_Name(), returnType , argumentTypen, kind));
|
||||
return il;
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,9 +4,9 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.NewArray.8641.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -134,7 +134,7 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
InstructionList il = new InstructionList();
|
||||
|
||||
il.append(expr.elementAt(0).genByteCode(_cg, rs));
|
||||
il.append(_factory.createNewArray( org.apache.commons.bcel6.generic.Type.getType(getTypeName()), (short)1));
|
||||
il.append(_factory.createNewArray( org.apache.bcel.generic.Type.getType(getTypeName()), (short)1));
|
||||
|
||||
|
||||
return il;
|
||||
|
@ -8,12 +8,12 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
@ -214,12 +214,12 @@ public class NewClass extends Expr
|
||||
if(arglist!=null){
|
||||
il.append(arglist.generateBytecode(_cg, rs));
|
||||
il.append(_cg.getInstructionFactory().createInvoke(description, "<init>",
|
||||
org.apache.commons.bcel6.generic.Type.VOID,
|
||||
org.apache.bcel.generic.Type.VOID,
|
||||
this.arglist.getBytecodeTypeList(_cg, rs), Constants.INVOKESPECIAL));
|
||||
}else{
|
||||
il.append(_cg.getInstructionFactory().createInvoke(description, "<init>",
|
||||
org.apache.commons.bcel6.generic.Type.VOID,
|
||||
new org.apache.commons.bcel6.generic.Type[]{}, Constants.INVOKESPECIAL));
|
||||
org.apache.bcel.generic.Type.VOID,
|
||||
new org.apache.bcel.generic.Type[]{}, Constants.INVOKESPECIAL));
|
||||
}
|
||||
if(this.isStatement){
|
||||
il.append(InstructionConstants.POP);
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,10 +4,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.Null.8644.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionConstants;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionConstants;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,8 +4,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.PositivExpr.8645.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,11 +5,11 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BIPUSH;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.IINC;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.BIPUSH;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.IINC;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -5,8 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,10 +4,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.Return.8651.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -134,7 +134,7 @@ public class Return extends Statement
|
||||
|
||||
InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
|
||||
|
||||
org.apache.commons.bcel6.generic.Type retType = this.getReturnType().getBytecodeType(cg, rs);//retexpr.getType().getBytecodeType();
|
||||
org.apache.bcel.generic.Type retType = this.getReturnType().getBytecodeType(cg, rs);//retexpr.getType().getBytecodeType();
|
||||
il.append(_factory.createReturn(retType ));
|
||||
|
||||
return il;
|
||||
|
@ -5,10 +5,10 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -11,12 +11,12 @@ import de.dhbwstuttgart.typeinference.Menge;
|
||||
// ino.module.StringLiteral.8653.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.ConstantPool;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.ConstantPoolGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.LDC;
|
||||
import org.apache.bcel.classfile.ConstantPool;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ConstantPoolGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.LDC;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,11 +4,11 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.This.8654.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.Constants;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.Constants;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -94,9 +94,9 @@ public class SuperCall extends ThisCall
|
||||
InstructionList il = new InstructionList();
|
||||
Type superClass = this.getParentClass().getSuperClass();
|
||||
//Instructionhandle dynamisch
|
||||
InstructionHandle ih_0 = il.append(_factory.createLoad( org.apache.commons.bcel6.generic.Type.OBJECT, 0));
|
||||
il.append(_factory.createInvoke(superClass.getName().toString(), "<init>", org.apache.commons.bcel6.generic.Type.VOID, org.apache.commons.bcel6.generic.Type.NO_ARGS, Constants.INVOKESPECIAL));
|
||||
//InstructionHandle ih_4 = il.append(_factory.createReturn( org.apache.commons.bcel6.generic.Type.VOID));
|
||||
InstructionHandle ih_0 = il.append(_factory.createLoad( org.apache.bcel.generic.Type.OBJECT, 0));
|
||||
il.append(_factory.createInvoke(superClass.getName().toString(), "<init>", org.apache.bcel.generic.Type.VOID, org.apache.bcel.generic.Type.NO_ARGS, Constants.INVOKESPECIAL));
|
||||
//InstructionHandle ih_4 = il.append(_factory.createReturn( org.apache.bcel.generic.Type.VOID));
|
||||
|
||||
return il;
|
||||
}
|
||||
|
@ -4,12 +4,12 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.This.8654.import
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.InstructionFactory;
|
||||
import org.apache.commons.bcel6.generic.InstructionHandle;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.commons.bcel6.generic.MethodGen;
|
||||
import org.apache.commons.bcel6.generic.ObjectType;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionHandle;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
import org.apache.bcel.generic.MethodGen;
|
||||
import org.apache.bcel.generic.ObjectType;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
@ -148,7 +148,7 @@ public class This extends Expr
|
||||
@Override
|
||||
public InstructionList genByteCode(ClassGenerator _cg, TypeinferenceResultSet rs) {
|
||||
InstructionList il = new InstructionList();
|
||||
il.append(InstructionFactory.createLoad( org.apache.commons.bcel6.generic.Type.OBJECT, 0));
|
||||
il.append(InstructionFactory.createLoad( org.apache.bcel.generic.Type.OBJECT, 0));
|
||||
return il;
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,12 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.bcel6.generic.BranchInstruction;
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.commons.bcel6.generic.DUP;
|
||||
import org.apache.commons.bcel6.generic.GOTO;
|
||||
import org.apache.commons.bcel6.generic.IFEQ;
|
||||
import org.apache.commons.bcel6.generic.InstructionList;
|
||||
import org.apache.bcel.generic.BranchInstruction;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.DUP;
|
||||
import org.apache.bcel.generic.GOTO;
|
||||
import org.apache.bcel.generic.IFEQ;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -159,7 +159,7 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer,
|
||||
|
||||
/*
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg) {
|
||||
return new de.dhbwstuttgart.bytecode.WildcardType(this.innerType.get_Name(), "+");
|
||||
}
|
||||
*/
|
||||
|
@ -173,7 +173,7 @@ public class FreshWildcardType extends ObjectType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
// TODO: Bytecode
|
||||
return null;
|
||||
}
|
||||
|
@ -232,9 +232,9 @@ public class GenericTypeVar extends ObjectType
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
// TODO Bytecode
|
||||
return org.apache.commons.bcel6.generic.Type.getType(getSignatureType(null));// new org.apache.commons.bcel6.generic.ObjectType("Object");
|
||||
return org.apache.bcel.generic.Type.getType(getSignatureType(null));// new org.apache.bcel.generic.ObjectType("Object");
|
||||
}
|
||||
|
||||
|
||||
|
@ -566,11 +566,11 @@ public class RefType extends ObjectType implements IMatchable
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
org.apache.commons.bcel6.generic.ObjectType ret = new org.apache.commons.bcel6.generic.ObjectType(getCombinedType(cg, rs));
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
org.apache.bcel.generic.ObjectType ret = new org.apache.bcel.generic.ObjectType(getCombinedType(cg, rs));
|
||||
if(this.IsArray()){
|
||||
//Hier wird einfachhalber von einer Dimension ausgegangen. Arrays sind im Bytecode nur für main-Methode relevant
|
||||
return new org.apache.commons.bcel6.generic.ArrayType(ret, 1);
|
||||
return new org.apache.bcel.generic.ArrayType(ret, 1);
|
||||
}else{
|
||||
return ret;
|
||||
}
|
||||
@ -585,7 +585,7 @@ public class RefType extends ObjectType implements IMatchable
|
||||
|
||||
cg.addExtraClass(generatedClass.genByteCode(new TypeinferenceResults()).getByteCode());
|
||||
}
|
||||
String ret = new org.apache.commons.bcel6.generic.ObjectType(combinedType).getSignature();
|
||||
String ret = new org.apache.bcel.generic.ObjectType(combinedType).getSignature();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I
|
||||
|
||||
/*
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg) {
|
||||
//return new de.dhbwstuttgart.bytecode.WildcardType(this.innerType.get_Name(), "-");
|
||||
return this.innerType.getBytecodeType(cg);
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset
|
||||
return this;
|
||||
}
|
||||
|
||||
public abstract org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs);
|
||||
public abstract org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs);
|
||||
|
||||
/**
|
||||
* Erzeugt einen String, welcher den Typ genauer angibt.
|
||||
|
@ -437,7 +437,7 @@ public class TypePlaceholder extends ObjectType
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
Type resolvedType = rs.getTypeOfPlaceholder(this);
|
||||
if(resolvedType instanceof TypePlaceholder){
|
||||
return DHBWInstructionFactory.createObjectType();
|
||||
@ -463,7 +463,7 @@ public class TypePlaceholder extends ObjectType
|
||||
ret+=":";
|
||||
Menge<TypePlaceholder> possibleTPHs = cg.getUsedTPH();
|
||||
possibleTPHs.remove(this);
|
||||
org.apache.commons.bcel6.generic.Type nearestType = cg.getNearestUsedType(this, possibleTPHs);
|
||||
org.apache.bcel.generic.Type nearestType = cg.getNearestUsedType(this, possibleTPHs);
|
||||
//if(nearestType instanceof TypePlaceholderType){ //Handelt es sich um einen weiteren TPH als nächsten Typ, so ist es ein allgemeiner Typ und wir nehmen Object als Superklasse
|
||||
if(nearestType == null){
|
||||
ret += cg.getInstructionFactory().createObjectType().getSignature();
|
||||
|
@ -83,8 +83,8 @@ public class Void extends RefType
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
return org.apache.commons.bcel6.generic.Type.VOID;
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
return org.apache.bcel.generic.Type.VOID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,7 +103,7 @@ public class WildcardType extends Type{
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
public org.apache.bcel.generic.Type getBytecodeType(ClassGenerator cg, TypeinferenceResultSet rs) {
|
||||
return this.innerType.getBytecodeType(cg, rs);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.bcel6.generic.ClassGen;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
|
@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.JavaClass;
|
||||
import org.apache.bcel.classfile.JavaClass;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
|
@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.bcel6.classfile.JavaClass;
|
||||
import org.apache.bcel.classfile.JavaClass;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user