modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java

Resultmodell aktiviert
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
a < void und void < a => a = void.
This commit is contained in:
pl@gohorb.ba-horb.de 2023-11-08 18:28:54 +01:00
parent a3d63a0266
commit a84d1ffdd7
3 changed files with 20 additions and 7 deletions

View File

@ -68,10 +68,10 @@ public class JavaTXCompiler {
// public static JavaTXCompiler INSTANCE;
final CompilationEnvironment environment;
Boolean resultmodel = false;
Boolean resultmodel = true;
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+""/logFiles/"" geschrieben werden soll?
Boolean log = false; //gibt an ob ein Log-File nach System.getProperty("user.dir")+""/logFiles/"" geschrieben werden soll?
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
private final DirectoryClassLoader classLoader;

View File

@ -2024,10 +2024,15 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && lhsType instanceof PlaceholderType) {
//System.out.println(pair);
if (first) { //writeLog(pair.toString()+"\n");
if (((PlaceholderType)(pair.getLhsType())).getName().equals("AR")) {
System.out.println("AR");
Set<Set<UnifyPair>> x1 = new HashSet<>();
if (pair.getRhsType().getName().equals("void")) {
Set<UnifyPair> resultOne = new HashSet<>();
resultOne.add(new UnifyPair (pair.getLhsType(), pair.getRhsType(), PairOperator.EQUALSDOT, pair.getSubstitution(), pair));
x1.add(resultOne);
}
else {
x1 = unifyCase1(pair, fc);
}
Set<Set<UnifyPair>> x1 = unifyCase1(pair, fc);
if (pairOp == PairOperator.SMALLERNEQDOT) {
Set<UnifyPair> remElem = new HashSet<>();
remElem.add(new UnifyPair(pair.getLhsType(), pair.getRhsType(), PairOperator.EQUALSDOT));
@ -2159,7 +2164,15 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
// Case 5: (Theta <. a)
else if ((pairOp == PairOperator.SMALLERDOT) && rhsType instanceof PlaceholderType)
if (first) { //writeLog(pair.toString()+"\n");
Set<Set<UnifyPair>> x1 = unifyCase5(pair, fc);
Set<Set<UnifyPair>> x1 = new HashSet<>();
if (pair.getLhsType().getName().equals("void")) {
Set<UnifyPair> resultOne = new HashSet<>();
resultOne.add(new UnifyPair (pair.getRhsType(), pair.getLhsType(), PairOperator.EQUALSDOT, pair.getSubstitution(), pair));
x1.add(resultOne);
}
else {
x1 = unifyCase5(pair, fc);
}
result.get(4).add(x1);
if (x1.isEmpty()) {
undefined.add(pair); //Theta ist nicht im FC

View File

@ -234,7 +234,7 @@ public class TestComplete {
}
@Test
@Ignore("This one isn't working")
//@Ignore("This is to complex")
public void matrixTest() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Matrix.jav");
var matrix = classFiles.get("Matrix");