Signatur ist das gleiche wie Description

This commit is contained in:
Enrico Schrödter 2015-10-27 13:27:00 +01:00
parent 52be0a1af3
commit 12093f2fc7
4 changed files with 14 additions and 18 deletions

View File

@ -236,7 +236,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns
public String getDescription() { public String getDescription() {
String ret = ""; String ret = "";
if(this.getType() != null && !(this.getType() instanceof TypePlaceholder)){ if(this.getType() != null && !(this.getType() instanceof TypePlaceholder)){
ret += this.getType().getName() + " "; ret += this.getType().getBytecodeSignature(null);
} }
return ret+this.getIdentifier(); return ret+this.getIdentifier();
} }

View File

@ -4,7 +4,9 @@ import de.dhbwstuttgart.bytecode.ClassGenerator;
import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.Constructor; import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.misc.DeclId; import de.dhbwstuttgart.syntaxtree.misc.DeclId;
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
import de.dhbwstuttgart.syntaxtree.statement.Block; import de.dhbwstuttgart.syntaxtree.statement.Block;
import de.dhbwstuttgart.syntaxtree.statement.SuperCall; import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.typeinference.Menge;
@ -45,11 +47,17 @@ public class ASTFactory {
return new Constructor(method, superClass); 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 // TODO bytecode createClass
Class generatedClass = new Class(className, 0); Class generatedClass = new Class(className, 0);
generatedClass.addField(ASTFactory.createEmptyConstructor(superClass)); generatedClass.addField(ASTFactory.createEmptyConstructor(parent));
generatedClass.parserPostProcessing(superClass);
if(superClass != null){
generatedClass.superclassid = UsedId.createFromQualifiedName(superClass, 0);
}
//TODO bytecode parserPostProcressing ist die SuperKlasse oder eine Sourcefile?
generatedClass.parserPostProcessing(parent);
return generatedClass; return generatedClass;
} }

View File

@ -852,8 +852,8 @@ public class RefType extends ObjectType implements IMatchable
String combinedType = getCombinedType(cg); String combinedType = getCombinedType(cg);
if(!combinedType.equals(getName().toString())){ if(!combinedType.equals(getName().toString())){
// TODO bytecode statt getParentClass die eigene Class?!?! // TODO bytecode statt getParentClass die eigene Class?!?!
Class classObject = ASTFactory.createClass(getName().toString(), ASTFactory.createObjectClass()); Class classObject = ASTFactory.createClass(getName().toString(), null, ASTFactory.createObjectClass());
Class generatedClass = ASTFactory.createClass(getCombinedType(cg), classObject); Class generatedClass = ASTFactory.createClass(getCombinedType(cg), getName().toString(), classObject);
cg.addExtraClass(generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet())).getByteCode()); cg.addExtraClass(generatedClass.genByteCode(new TypeinferenceResultSet(generatedClass, new Menge<>(), new ResultSet())).getByteCode());
} }

View File

@ -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);
}
}