Fehler in TypeStmt beheben

This commit is contained in:
JanUlrich 2017-09-18 18:32:22 +02:00
parent 201a0978bc
commit f81496fe1f
6 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,9 @@
package de.dhbwstuttgart.core;
/**
* Stellt die Java-Environment dar
* Speichert alle Typen, Klassen aus den benutzen SourceFiles und Librarys
*/
public class CompilationEnvironment {
}

View File

@ -22,7 +22,11 @@ import java.util.stream.Collectors;
public class JavaTXCompiler { public class JavaTXCompiler {
protected List<SourceFile> sourceFiles = new ArrayList<>(); protected List<SourceFile> sourceFiles = new ArrayList<>();
/*
public JavaTXCompiler(List<File> sourceFiles){
}
*/
public List<ResultSet> typeInference(){ public List<ResultSet> typeInference(){
List<ClassOrInterface> allClasses = new ArrayList<>(); List<ClassOrInterface> allClasses = new ArrayList<>();
for(SourceFile sf : sourceFiles){ for(SourceFile sf : sourceFiles){

View File

@ -50,6 +50,7 @@ class Resolver implements ResultSetVisitor {
resultPair.accept(this); resultPair.accept(this);
} }
if(resolved==null){//TPH kommt nicht im Result vor: if(resolved==null){//TPH kommt nicht im Result vor:
resolved = tph;
} }
return new ResolvedType(resolved, additionalTPHs);//resolved; return new ResolvedType(resolved, additionalTPHs);//resolved;

View File

@ -260,6 +260,7 @@ public class TYPEStmt implements StatementVisitor{
protected Set<Pair> generateParameterConstraints(MethodCall foMethod, MethodAssumption assumption, TypeInferenceBlockInformation info) { protected Set<Pair> generateParameterConstraints(MethodCall foMethod, MethodAssumption assumption, TypeInferenceBlockInformation info) {
Set<Pair> ret = new HashSet<>(); Set<Pair> ret = new HashSet<>();
for(int i = 0;i<foMethod.arglist.getArguments().size();i++){ for(int i = 0;i<foMethod.arglist.getArguments().size();i++){
foMethod.arglist.getArguments().get(i).accept(this);
ret.add(ConstraintsFactory.createPair(foMethod.arglist.getArguments().get(i).getType(), ret.add(ConstraintsFactory.createPair(foMethod.arglist.getArguments().get(i).getType(),
assumption.getArgTypes().get(i), PairOperator.SMALLERDOT, info)); assumption.getArgTypes().get(i), PairOperator.SMALLERDOT, info));
} }

View File

@ -47,7 +47,6 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
} }
} }
} }
} }
static String readFile(String path, Charset encoding) static String readFile(String path, Charset encoding)