forked from JavaTX/JavaCompilerCore
ASTFactory.createClass gibt eine Class statt ClassGenerator zurück
This commit is contained in:
parent
422f3b4144
commit
fab73a4d62
@ -38,7 +38,7 @@ public class ASTFactory {
|
||||
return new Constructor(ASTFactory.createMethod("<init>", block, superClass), superClass);
|
||||
}
|
||||
|
||||
public static ClassGenerator createClass(String className, Class superClass) {
|
||||
public static Class createClass(String className, Class superClass) {
|
||||
// TODO bytecode createClass
|
||||
Class generatedClass = new Class(className, 0);
|
||||
Block konstruktorBlock = new Block();
|
||||
@ -49,6 +49,6 @@ public class ASTFactory {
|
||||
|
||||
generatedClass.addField(standardKonstruktor);
|
||||
|
||||
return generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet())).getByteCode();
|
||||
return generatedClass;
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,17 @@ import de.dhbwstuttgart.core.IItemWithOffset;
|
||||
import de.dhbwstuttgart.myexception.SCException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.TypeInsertable;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionGenVar;
|
||||
@ -839,7 +844,10 @@ public class RefType extends ObjectType implements IMatchable
|
||||
//TODO: bytecode woher bekommt ich die parent klasse
|
||||
String combinedType = getCombinedType(cg);
|
||||
if(!combinedType.equals(get_Name())){
|
||||
cg.addExtraClass(ASTFactory.createClass(getCombinedType(cg), getParentClass()));
|
||||
// TODO bytecode createClass
|
||||
Class generatedClass = ASTFactory.createClass(getCombinedType(cg), getParentClass());
|
||||
|
||||
cg.addExtraClass(generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet())).getByteCode());
|
||||
}
|
||||
|
||||
return "L"+getCombinedType(cg)+";";
|
||||
|
Loading…
Reference in New Issue
Block a user