forked from JavaTX/JavaCompilerCore
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:
parent
a3d63a0266
commit
a84d1ffdd7
@ -68,10 +68,10 @@ public class JavaTXCompiler {
|
|||||||
|
|
||||||
// public static JavaTXCompiler INSTANCE;
|
// public static JavaTXCompiler INSTANCE;
|
||||||
final CompilationEnvironment environment;
|
final CompilationEnvironment environment;
|
||||||
Boolean resultmodel = false;
|
Boolean resultmodel = true;
|
||||||
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
|
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();
|
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
|
||||||
private final DirectoryClassLoader classLoader;
|
private final DirectoryClassLoader classLoader;
|
||||||
|
|
||||||
|
@ -2024,10 +2024,15 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && lhsType instanceof PlaceholderType) {
|
if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && lhsType instanceof PlaceholderType) {
|
||||||
//System.out.println(pair);
|
//System.out.println(pair);
|
||||||
if (first) { //writeLog(pair.toString()+"\n");
|
if (first) { //writeLog(pair.toString()+"\n");
|
||||||
if (((PlaceholderType)(pair.getLhsType())).getName().equals("AR")) {
|
Set<Set<UnifyPair>> x1 = new HashSet<>();
|
||||||
System.out.println("AR");
|
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) {
|
if (pairOp == PairOperator.SMALLERNEQDOT) {
|
||||||
Set<UnifyPair> remElem = new HashSet<>();
|
Set<UnifyPair> remElem = new HashSet<>();
|
||||||
remElem.add(new UnifyPair(pair.getLhsType(), pair.getRhsType(), PairOperator.EQUALSDOT));
|
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)
|
// Case 5: (Theta <. a)
|
||||||
else if ((pairOp == PairOperator.SMALLERDOT) && rhsType instanceof PlaceholderType)
|
else if ((pairOp == PairOperator.SMALLERDOT) && rhsType instanceof PlaceholderType)
|
||||||
if (first) { //writeLog(pair.toString()+"\n");
|
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);
|
result.get(4).add(x1);
|
||||||
if (x1.isEmpty()) {
|
if (x1.isEmpty()) {
|
||||||
undefined.add(pair); //Theta ist nicht im FC
|
undefined.add(pair); //Theta ist nicht im FC
|
||||||
|
@ -234,7 +234,7 @@ public class TestComplete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("This one isn't working")
|
//@Ignore("This is to complex")
|
||||||
public void matrixTest() throws Exception {
|
public void matrixTest() throws Exception {
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Matrix.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Matrix.jav");
|
||||||
var matrix = classFiles.get("Matrix");
|
var matrix = classFiles.get("Matrix");
|
||||||
|
Loading…
Reference in New Issue
Block a user