Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode

# Conflicts:
#	src/de/dhbwstuttgart/syntaxtree/Class.java
This commit is contained in:
Enrico Schrödter 2015-10-23 16:26:25 +02:00
commit 47361ca22c

View File

@ -223,8 +223,8 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I
superclassid=null; superclassid=null;
} }
this.offset = offset; this.offset = offset;
if(!name.equals("Object"))//Alle Klassen außer Object erben von Object: if(!name.equals("Object") && !name.equals("java.lang.Object"))//Alle Klassen außer Object erben von Object:
this.superClass = new Class("Object", -1).getType(); this.superClass = new Class("java.lang.Object", -1).getType();
} }
// ino.end // ino.end
@ -1026,5 +1026,67 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I
public boolean isInterface(){ public boolean isInterface(){
return false; return false;
} }
/*
private Collection<? extends ByteCodeResult> getGenericClasses() {
Collection<ByteCodeResult> results = new Menge<>();
for(Field field : this.fielddecl){
Type type = field.getType();
//Der Type des Feldes
if(type instanceof RefType){
RefType refType = (RefType) type;
if(!refType.getCombinedType(null).equals(refType.get_Name().replace(".", "%"))){
results.addAll(generateGenericClass(refType.getCombinedType(null), new Class("java/util/Vector",-1)));
}
}
if(field instanceof Method){
Method method = (Method) field;
ParameterList parameterList = method.getParameterList();
//Die Typen der Methodenparameter
for(FormalParameter parameter: parameterList){
Type parameterType = parameter.getType();
if(parameterType instanceof RefType){
RefType refType = (RefType) parameterType;
if(!refType.getCombinedType(null).equals(refType.get_Name().replace(".", "%"))){
results.addAll(generateGenericClass(refType.getCombinedType(null), new Class("java/util/Vector",-1)));
}
}
}
}
}
return results;
}
*/
/*
private Menge<ByteCodeResult> generateGenericClass(String name, Class superClass){
//TODO: bytecode -- Generics hinzuf<EFBFBD>gen
//Type superClassType = superClass.getType();
//TODO: bytecode
//ClassGenerator genericClassGenerator = new ClassGenerator(name, superClassType, name + ".java", Constants.ACC_PUBLIC , new String[] { }, new TypeinferenceResultSet(null, null, null));
//TODO: bytecode -- Namen der neuen Klasse
Class generatedClass = new Class(name, 0);
//TODO: bytecode -- alle Konstruktoren generieren
Block konstruktorBlock = new Block();
konstruktorBlock.setType(new de.dhbwstuttgart.syntaxtree.type.Void(konstruktorBlock, 0));
konstruktorBlock.statements.add(new SuperCall(konstruktorBlock));
Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(konstruktorBlock, name, superClass), superClass);
standardKonstruktor.parserPostProcessing(generatedClass);
generatedClass.addField(standardKonstruktor);
return generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet()));
}
*/
} }
// ino.end // ino.end