Finite CLosure TEst läuft wieder halbwegs. Sonst unfertiger Zustand

This commit is contained in:
JanUlrich 2017-11-16 15:10:08 +01:00
parent b51d8356b7
commit 16e14f9363
9 changed files with 32 additions and 7 deletions

View File

@ -70,7 +70,7 @@ public class JavaTXCompiler {
xConsSet.addAll(constraint);
}
//System.out.println(xConsSet);
System.out.println(xConsSet);
Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
//System.out.println("RESULT: " + result);
results.addAll(result);

View File

@ -35,6 +35,11 @@ public class ExtendsWildcardType extends WildcardType{
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
@Override
public <A> A acceptTV(TypeVisitor<A> visitor) {
return visitor.visit(this);

View File

@ -24,6 +24,11 @@ public class GenericRefType extends RefTypeOrTPHOrWildcardOrGeneric
return name.toString();
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
@Override
public <A> A acceptTV(TypeVisitor<A> visitor) {
return visitor.visit(this);

View File

@ -95,6 +95,11 @@ public class RefType extends RefTypeOrTPHOrWildcardOrGeneric
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
@Override
public <A> A acceptTV(TypeVisitor<A> visitor) {
return visitor.visit(this);

View File

@ -11,9 +11,7 @@ public abstract class RefTypeOrTPHOrWildcardOrGeneric extends SyntaxTreeNode{
}
@Override
public void accept(ASTVisitor visitor){
this.acceptTV((TypeVisitor)visitor);
}
public abstract void accept(ASTVisitor visitor);
public abstract <A> A acceptTV(TypeVisitor<A> visitor);
public abstract void accept(ResultSetVisitor visitor);

View File

@ -45,6 +45,11 @@ public class SuperWildcardType extends WildcardType{
return true;
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
@Override
public <A> A acceptTV(TypeVisitor<A> visitor) {
return visitor.visit(this);

View File

@ -68,6 +68,11 @@ public class TypePlaceholder extends RefTypeOrTPHOrWildcardOrGeneric
return name;
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
@Override
public <A> A acceptTV(TypeVisitor<A> visitor) {
return visitor.visit(this);

View File

@ -321,6 +321,7 @@ public class TYPEStmt implements StatementVisitor{
public static List<MethodAssumption> getMethods(String name, int numArgs, TypeInferenceBlockInformation info) {
List<MethodAssumption> ret = new ArrayList<>();
//TODO: apply Methoden wieder anfügen. Diese könnten möglicherweise auch in den Assumptions auftauchen (überdenken)
/*
if(name.equals("apply")){
List<RefTypeOrTPHOrWildcardOrGeneric> funNParams = new ArrayList<>();

View File

@ -1,13 +1,14 @@
import java.util.*;
import java.util.List;
class Test{
methode(param1, param2, param3) {
return param1.meth(param2.add(param3));
param2.add(param3);
return param1.meth(param2);
}
}
interface Klasse1{
Klasse1 meth(Klasse1 p);
Klasse1 meth(List p);
Klasse1 meth(Klasse2 p);
}