forked from JavaTX/JavaCompilerCore
Signatur ist das gleiche wie Description
This commit is contained in:
parent
52be0a1af3
commit
12093f2fc7
@ -236,7 +236,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns
|
||||
public String getDescription() {
|
||||
String ret = "";
|
||||
if(this.getType() != null && !(this.getType() instanceof TypePlaceholder)){
|
||||
ret += this.getType().getName() + " ";
|
||||
ret += this.getType().getBytecodeSignature(null);
|
||||
}
|
||||
return ret+this.getIdentifier();
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import de.dhbwstuttgart.bytecode.ClassGenerator;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
@ -45,11 +47,17 @@ public class ASTFactory {
|
||||
return new Constructor(method, superClass);
|
||||
}
|
||||
|
||||
public static Class createClass(String className, Class superClass) {
|
||||
public static Class createClass(String className, String superClass, Class parent) {
|
||||
// TODO bytecode createClass
|
||||
Class generatedClass = new Class(className, 0);
|
||||
generatedClass.addField(ASTFactory.createEmptyConstructor(superClass));
|
||||
generatedClass.parserPostProcessing(superClass);
|
||||
generatedClass.addField(ASTFactory.createEmptyConstructor(parent));
|
||||
|
||||
if(superClass != null){
|
||||
generatedClass.superclassid = UsedId.createFromQualifiedName(superClass, 0);
|
||||
}
|
||||
|
||||
//TODO bytecode parserPostProcressing ist die SuperKlasse oder eine Sourcefile?
|
||||
generatedClass.parserPostProcessing(parent);
|
||||
|
||||
return generatedClass;
|
||||
}
|
||||
|
@ -852,8 +852,8 @@ public class RefType extends ObjectType implements IMatchable
|
||||
String combinedType = getCombinedType(cg);
|
||||
if(!combinedType.equals(getName().toString())){
|
||||
// TODO bytecode statt getParentClass die eigene Class?!?!
|
||||
Class classObject = ASTFactory.createClass(getName().toString(), ASTFactory.createObjectClass());
|
||||
Class generatedClass = ASTFactory.createClass(getCombinedType(cg), classObject);
|
||||
Class classObject = ASTFactory.createClass(getName().toString(), null, ASTFactory.createObjectClass());
|
||||
Class generatedClass = ASTFactory.createClass(getCombinedType(cg), getName().toString(), classObject);
|
||||
|
||||
cg.addExtraClass(generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet())).getByteCode());
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
import java.util.Vector;
|
||||
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Overloading o = new Overloading();
|
||||
Vector<String> stringVector = new Vector<String>();
|
||||
|
||||
o.method(stringVector);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user