diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java index 9f77ff89..56f2200f 100644 --- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -18,13 +18,13 @@ import de.dhbwstuttgart.parser.antlr.Java8Parser.CompilationUnitContext; import de.dhbwstuttgart.parser.scope.GenericsRegistry; import de.dhbwstuttgart.parser.scope.JavaClassName; import de.dhbwstuttgart.strucTypes.Construct; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.Solve; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; import de.dhbwstuttgart.strucTypes.exception.InconsistentConstraintsException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.model.SolvedClass; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.SourceFile; diff --git a/src/de/dhbwstuttgart/strucTypes/Construct.java b/src/de/dhbwstuttgart/strucTypes/Construct.java index 88619bb1..eb744dd7 100644 --- a/src/de/dhbwstuttgart/strucTypes/Construct.java +++ b/src/de/dhbwstuttgart/strucTypes/Construct.java @@ -14,6 +14,7 @@ import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.IllegalInterfaceTypeException; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.visitor.DefaultASTVisitor; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Constructor; diff --git a/src/de/dhbwstuttgart/strucTypes/RuleSetStrucType.java b/src/de/dhbwstuttgart/strucTypes/RuleSetStrucType.java index b0a5d1fa..1079037b 100644 --- a/src/de/dhbwstuttgart/strucTypes/RuleSetStrucType.java +++ b/src/de/dhbwstuttgart/strucTypes/RuleSetStrucType.java @@ -22,15 +22,15 @@ import javafx.util.Pair; public class RuleSetStrucType extends RuleSet { - public Optional> reduce(UnifyPair pair) { + public Optional> strucTypeReduce(UnifyPair pair) { return super.reduce2(pair); } - public Optional adapt1(UnifyPair pair, IFiniteClosure fc) { + public Optional strucTypeAdapt1(UnifyPair pair, IFiniteClosure fc) { return super.adapt(pair, fc); } - public Optional> adapt2(Set pairs, IFiniteClosure fc) { + public Optional> strucTypeAdapt2(Set pairs, IFiniteClosure fc) { // Filter SMALLERDOT Pairs final Set pairsSmallerDot = pairs.stream().filter(p -> PairOperator.SMALLERDOT.equals(p.getPairOp())) .collect(Collectors.toSet()); @@ -105,23 +105,23 @@ public class RuleSetStrucType extends RuleSet { return Optional.empty(); } - public boolean erase1(UnifyPair pair, IFiniteClosure fc) { + public boolean strucTypeErase1(UnifyPair pair, IFiniteClosure fc) { return super.erase1(pair, fc); } - public boolean erase2(UnifyPair pair) { + public boolean strucTypeErase2(UnifyPair pair) { return super.erase3(pair); } - public Optional swap(UnifyPair pair) { + public Optional strucTypeSwap(UnifyPair pair) { return super.swap(pair); } - public Optional> subst(Set pairs) { + public Optional> strucTypeSubst(Set pairs) { return super.subst(pairs); } - public Optional> refl(Set pairs) { + public Optional> strucTypeRefl(Set pairs) { // Filter SMALLERDOT Pairs final Set pairsSmallerDot = pairs.stream().filter(p -> PairOperator.SMALLERDOT.equals(p.getPairOp())) .collect(Collectors.toSet()); diff --git a/src/de/dhbwstuttgart/strucTypes/Solve.java b/src/de/dhbwstuttgart/strucTypes/Solve.java index 3cfbb4cb..3c866e0d 100644 --- a/src/de/dhbwstuttgart/strucTypes/Solve.java +++ b/src/de/dhbwstuttgart/strucTypes/Solve.java @@ -12,6 +12,7 @@ import java.util.stream.Stream; import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.InconsistentConstraintsException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.model.SolvedClass; import de.dhbwstuttgart.strucTypes.visitor.InferTypes; import de.dhbwstuttgart.strucTypes.visitor.TypeExtract; @@ -102,7 +103,7 @@ public class Solve { throw new InconsistentConstraintsException(); } return new SolvedClass(this.clsA.accept(new InferTypes(inferredTypes, tNew)), tNew, - this.constraints, this.generatedInterfaces); + cs, this.generatedInterfaces); } diff --git a/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java b/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java index f45cb835..1b9e0028 100644 --- a/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java +++ b/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java @@ -1,7 +1,9 @@ package de.dhbwstuttgart.strucTypes; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.visitor.DefaultASTVisitor; +import de.dhbwstuttgart.strucTypes.visitor.TYPEExpr; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.statement.Expression; diff --git a/src/de/dhbwstuttgart/strucTypes/StrucTypeUnify.java b/src/de/dhbwstuttgart/strucTypes/StrucTypeUnify.java index e8ab9ea2..93dabaca 100644 --- a/src/de/dhbwstuttgart/strucTypes/StrucTypeUnify.java +++ b/src/de/dhbwstuttgart/strucTypes/StrucTypeUnify.java @@ -37,14 +37,14 @@ public class StrucTypeUnify { UnifyPair pair = pairQueue.pollFirst(); // reduce - Optional> optSet = rules.reduce(pair); + Optional> optSet = rules.strucTypeReduce(pair); if (optSet.isPresent()) { optSet.get().forEach(p -> swapAddOrErase(p, fc, pairQueue)); continue; } // adapt1 - Optional opt = rules.adapt1(pair, fc); + Optional opt = rules.strucTypeAdapt1(pair, fc); if (opt.isPresent()) { this.swapAddOrErase(opt.get(), fc, pairQueue); @@ -56,19 +56,19 @@ public class StrucTypeUnify { } // adapt2 - Optional> adapt2 = rules.adapt2(resultSet, fc); + Optional> adapt2 = rules.strucTypeAdapt2(resultSet, fc); if(adapt2.isPresent()){ resultSet = this.applyTypeUnificationRules(adapt2.get(), fc); } // subst - Optional> subst = rules.subst(resultSet); + Optional> subst = rules.strucTypeSubst(resultSet); if(subst.isPresent()){ resultSet = this.applyTypeUnificationRules(subst.get(), fc); } // refl - Optional> refl = rules.refl(resultSet); + Optional> refl = rules.strucTypeRefl(resultSet); if(refl.isPresent()){ resultSet = this.applyTypeUnificationRules(refl.get(), fc); } @@ -78,11 +78,11 @@ public class StrucTypeUnify { private void swapAddOrErase(UnifyPair pair, IFiniteClosure fc, Collection collection) { // swap - Optional opt = rules.swap(pair); + Optional opt = rules.strucTypeSwap(pair); UnifyPair unifyPair = opt.isPresent() ? opt.get() : pair; // erase - if (rules.erase1(unifyPair, fc) || rules.erase2(unifyPair)) + if (rules.strucTypeErase1(unifyPair, fc) || rules.strucTypeErase2(unifyPair)) return; collection.add(unifyPair); } diff --git a/src/de/dhbwstuttgart/strucTypes/StrucTypeUnifyUtils.java b/src/de/dhbwstuttgart/strucTypes/StrucTypeUnifyUtils.java index b1b27a84..24d72df3 100644 --- a/src/de/dhbwstuttgart/strucTypes/StrucTypeUnifyUtils.java +++ b/src/de/dhbwstuttgart/strucTypes/StrucTypeUnifyUtils.java @@ -9,6 +9,7 @@ import java.util.Set; import java.util.stream.Collectors; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; diff --git a/src/de/dhbwstuttgart/strucTypes/constraint/ConstraintsSet.java b/src/de/dhbwstuttgart/strucTypes/constraint/ConstraintsSet.java index 87f27450..3dfc5b3a 100644 --- a/src/de/dhbwstuttgart/strucTypes/constraint/ConstraintsSet.java +++ b/src/de/dhbwstuttgart/strucTypes/constraint/ConstraintsSet.java @@ -3,7 +3,7 @@ package de.dhbwstuttgart.strucTypes.constraint; import java.util.HashSet; import java.util.Set; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; public class ConstraintsSet { diff --git a/src/de/dhbwstuttgart/strucTypes/constraint/FieldConstraint.java b/src/de/dhbwstuttgart/strucTypes/constraint/FieldConstraint.java index a816efef..5130c99a 100644 --- a/src/de/dhbwstuttgart/strucTypes/constraint/FieldConstraint.java +++ b/src/de/dhbwstuttgart/strucTypes/constraint/FieldConstraint.java @@ -1,6 +1,6 @@ package de.dhbwstuttgart.strucTypes.constraint; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.visitor.InferTypes; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; diff --git a/src/de/dhbwstuttgart/strucTypes/constraint/MethodConstraint.java b/src/de/dhbwstuttgart/strucTypes/constraint/MethodConstraint.java index 772bbe9a..3fc1c134 100644 --- a/src/de/dhbwstuttgart/strucTypes/constraint/MethodConstraint.java +++ b/src/de/dhbwstuttgart/strucTypes/constraint/MethodConstraint.java @@ -5,7 +5,7 @@ import java.util.List; import org.antlr.v4.runtime.Token; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.visitor.InferTypes; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; diff --git a/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java b/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java index 11fede11..e425a6bd 100644 --- a/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java +++ b/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java @@ -1,7 +1,7 @@ package de.dhbwstuttgart.strucTypes.constraint; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.visitor.InferTypes; import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory; import de.dhbwstuttgart.syntaxtree.type.RefType; diff --git a/src/de/dhbwstuttgart/strucTypes/exception/IllegalInterfaceTypeException.java b/src/de/dhbwstuttgart/strucTypes/exception/IllegalInterfaceTypeException.java index d144925d..f0341a9b 100644 --- a/src/de/dhbwstuttgart/strucTypes/exception/IllegalInterfaceTypeException.java +++ b/src/de/dhbwstuttgart/strucTypes/exception/IllegalInterfaceTypeException.java @@ -5,28 +5,23 @@ public class IllegalInterfaceTypeException extends RuntimeException { private static final long serialVersionUID = 1L; public IllegalInterfaceTypeException() { - // TODO Auto-generated constructor stub } public IllegalInterfaceTypeException(String message) { super(message); - // TODO Auto-generated constructor stub } public IllegalInterfaceTypeException(Throwable cause) { super(cause); - // TODO Auto-generated constructor stub } public IllegalInterfaceTypeException(String message, Throwable cause) { super(message, cause); - // TODO Auto-generated constructor stub } public IllegalInterfaceTypeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); - // TODO Auto-generated constructor stub } } diff --git a/src/de/dhbwstuttgart/strucTypes/InferredTypes.java b/src/de/dhbwstuttgart/strucTypes/model/InferredTypes.java similarity index 94% rename from src/de/dhbwstuttgart/strucTypes/InferredTypes.java rename to src/de/dhbwstuttgart/strucTypes/model/InferredTypes.java index ec6207c1..fee3d918 100644 --- a/src/de/dhbwstuttgart/strucTypes/InferredTypes.java +++ b/src/de/dhbwstuttgart/strucTypes/model/InferredTypes.java @@ -1,4 +1,4 @@ -package de.dhbwstuttgart.strucTypes; +package de.dhbwstuttgart.strucTypes.model; import java.util.Collection; import java.util.HashMap; diff --git a/src/de/dhbwstuttgart/strucTypes/printutils/PrintInferredTypes.java b/src/de/dhbwstuttgart/strucTypes/printutils/PrintInferredTypes.java index ae6ccdc3..796bd455 100644 --- a/src/de/dhbwstuttgart/strucTypes/printutils/PrintInferredTypes.java +++ b/src/de/dhbwstuttgart/strucTypes/printutils/PrintInferredTypes.java @@ -1,6 +1,6 @@ package de.dhbwstuttgart.strucTypes.printutils; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; public class PrintInferredTypes { diff --git a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java index e3e4bbb2..a60cbd5c 100644 --- a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java +++ b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java @@ -7,7 +7,7 @@ import java.util.List; import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.scope.JavaClassName; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.ASTVisitor; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Constructor; diff --git a/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java b/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java index bb70713a..5e59c462 100644 --- a/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java @@ -10,7 +10,7 @@ import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.scope.JavaClassName; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Constructor; import de.dhbwstuttgart.syntaxtree.Field; @@ -121,7 +121,6 @@ public class InferTypes implements ASTReturnVisitor { List values = new ArrayList<>(); genericTypeVars.forEach(gtv -> values.add(gtv.accept(this))); return new GenericDeclarationList(values, genericTypeVars.getOffset()); - } @Override diff --git a/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java b/src/de/dhbwstuttgart/strucTypes/visitor/TYPEExpr.java similarity index 93% rename from src/de/dhbwstuttgart/strucTypes/TYPEExpr.java rename to src/de/dhbwstuttgart/strucTypes/visitor/TYPEExpr.java index 5ac34137..3cc5dcd8 100644 --- a/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/TYPEExpr.java @@ -1,4 +1,4 @@ -package de.dhbwstuttgart.strucTypes; +package de.dhbwstuttgart.strucTypes.visitor; import java.util.ArrayList; import java.util.List; @@ -8,8 +8,7 @@ import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.FieldConstraint; import de.dhbwstuttgart.strucTypes.constraint.MethodConstraint; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; -import de.dhbwstuttgart.strucTypes.visitor.DefaultASTVisitor; -import de.dhbwstuttgart.strucTypes.visitor.TypeExtract; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Field; import de.dhbwstuttgart.syntaxtree.FormalParameter; @@ -69,6 +68,7 @@ public class TYPEExpr extends DefaultASTVisitor { // Ermittelt den Typ ty von fieldVar.receiver und fields(f) TypeExtract fieldTypeVisitor = new TypeExtract(); + // unterscheide fieldVar.receiver == this if (receiverIsThis) { this.aThis.accept(fieldTypeVisitor); } else { @@ -84,6 +84,7 @@ public class TYPEExpr extends DefaultASTVisitor { fieldVar.getType()); this.constraints.addConstraint(fieldConstraint); } + this.constraints.inferTypes(fieldTypeVisitor.getGrtToTphMap()); } /** @@ -166,10 +167,6 @@ public class TYPEExpr extends DefaultASTVisitor { } else { type.accept(typeExtract); // implement generics nicht nötig - // ClassOrInterface orDefault = - // typedClasses.getOrDefault(type.getName(), - // ClassOrInterfaceFactory.createClass(type).get()); - // orDefault.accept(typeExtract); } this.createNewClassSubTypeConstraints(newClass, typeExtract); } @@ -191,7 +188,7 @@ public class TYPEExpr extends DefaultASTVisitor { .getFormalparalist(); for (int i = 0; i < argumentsSize; i++) { // Bei Fields wird kein GenericRefType sondern Object als Typ - // geparst. + // geparst. Workaround über den Konstruktor. // SubTypeConstraint subTypeConstraint = new // SubTypeConstraint(arguments.get(i).getType(), // fields.get(i).getType()); diff --git a/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java b/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java index 23d57730..a3565456 100644 --- a/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java @@ -6,9 +6,9 @@ import java.util.List; import java.util.Optional; import de.dhbwstuttgart.parser.scope.JavaClassName; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.model.ClassOrInterfaceFactory; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Constructor; import de.dhbwstuttgart.syntaxtree.Field; diff --git a/src/de/dhbwstuttgart/strucTypes/visitor/TypeVar.java b/src/de/dhbwstuttgart/strucTypes/visitor/TypeVar.java index 82ad319e..21125801 100644 --- a/src/de/dhbwstuttgart/strucTypes/visitor/TypeVar.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/TypeVar.java @@ -3,7 +3,7 @@ package de.dhbwstuttgart.strucTypes.visitor; import java.util.HashSet; import java.util.Set; -import de.dhbwstuttgart.strucTypes.InferredTypes; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.syntaxtree.AbstractASTWalker; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; diff --git a/test/strucType/TestASTPrinter.java b/test/strucType/TestASTPrinter.java new file mode 100644 index 00000000..4493ec3a --- /dev/null +++ b/test/strucType/TestASTPrinter.java @@ -0,0 +1,38 @@ +package strucType; + +import java.io.File; +import java.util.ArrayList; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; +import de.dhbwstuttgart.syntaxtree.SourceFile; +import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter; +import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter; + +public class TestASTPrinter { + public static final String rootDirectory = System.getProperty("user.dir") + "/test/strucType/javFiles/"; + + @Test + public void testASTPrinter() throws Exception { + ArrayList files = new ArrayList<>(); + files.add(new File(rootDirectory + "testLocalVar.jav")); + files.add(new File(rootDirectory + "testCast.jav")); + files.add(new File(rootDirectory + "testNew.jav")); + files.add(new File(rootDirectory + "testFieldVar.jav")); + files.add(new File(rootDirectory + "testFieldMethod.jav")); + files.add(new File(rootDirectory + "testMethod.jav")); + files.add(new File(rootDirectory + "testPaperExample.jav")); + JavaTXCompiler compiler = new JavaTXCompiler(files); + for (File f : compiler.sourceFiles.keySet()) { + String name = f.getName(); + System.out.println("Filename: " + name); + SourceFile sourceFile = compiler.sourceFiles.get(f); + String print = ASTPrinter.print(sourceFile); + System.out.println(print); + String print2 = ASTTypePrinter.print(sourceFile); + System.out.println(print2); + } + } + +} diff --git a/test/strucType/TestConstruct.java b/test/strucType/TestConstruct.java index c7110ab2..6d931a55 100644 --- a/test/strucType/TestConstruct.java +++ b/test/strucType/TestConstruct.java @@ -8,11 +8,11 @@ import java.util.Set; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.strucTypes.Construct; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.printutils.PrintConstraints; import de.dhbwstuttgart.strucTypes.printutils.PrintInferredTypes; import de.dhbwstuttgart.strucTypes.printutils.SyntaxTreePrinter; diff --git a/test/strucType/TestInferTypesVisitor.java b/test/strucType/TestInferTypesVisitor.java index 414b4bd4..9c75baf8 100644 --- a/test/strucType/TestInferTypesVisitor.java +++ b/test/strucType/TestInferTypesVisitor.java @@ -11,11 +11,11 @@ import org.junit.Test; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.strucTypes.Construct; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.printutils.PrintConstraints; import de.dhbwstuttgart.strucTypes.printutils.PrintInferredTypes; import de.dhbwstuttgart.strucTypes.printutils.SyntaxTreePrinter; diff --git a/test/strucType/TestPaperExample.java b/test/strucType/TestPaperExample.java index f8b200b2..e40b37f0 100644 --- a/test/strucType/TestPaperExample.java +++ b/test/strucType/TestPaperExample.java @@ -8,13 +8,13 @@ import java.util.Set; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.strucTypes.Construct; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.Solve; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; import de.dhbwstuttgart.strucTypes.exception.InconsistentConstraintsException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.model.SolvedClass; import de.dhbwstuttgart.strucTypes.printutils.PrintConstraints; import de.dhbwstuttgart.strucTypes.printutils.PrintInferredTypes; diff --git a/test/strucType/TestRuleSetStrucType.java b/test/strucType/TestRuleSetStrucType.java index d41f555a..cc06f569 100644 --- a/test/strucType/TestRuleSetStrucType.java +++ b/test/strucType/TestRuleSetStrucType.java @@ -36,7 +36,7 @@ public class TestRuleSetStrucType { pairs.add(p4); RuleSetStrucType rules = new RuleSetStrucType(); - Optional> opt = rules.refl(pairs); + Optional> opt = rules.strucTypeRefl(pairs); // System.out.println(opt.get()); Assert.assertTrue("Refl: " + opt.get(),opt.isPresent()); } diff --git a/test/strucType/TestSolve.java b/test/strucType/TestSolve.java index c90b3f80..5cf321ed 100644 --- a/test/strucType/TestSolve.java +++ b/test/strucType/TestSolve.java @@ -8,13 +8,13 @@ import java.util.Set; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.strucTypes.Construct; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.Solve; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.strucTypes.exception.ImpossibleSubTypeException; import de.dhbwstuttgart.strucTypes.exception.InconsistentConstraintsException; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.model.SolvedClass; import de.dhbwstuttgart.strucTypes.printutils.PrintConstraints; import de.dhbwstuttgart.strucTypes.printutils.PrintInferredTypes; diff --git a/test/strucType/TestStrucType.java b/test/strucType/TestStrucType.java index a929fa64..9abba6f0 100644 --- a/test/strucType/TestStrucType.java +++ b/test/strucType/TestStrucType.java @@ -5,9 +5,9 @@ import java.io.IOException; import java.util.ArrayList; import de.dhbwstuttgart.core.JavaTXCompiler; -import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.StrucTYPE; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; +import de.dhbwstuttgart.strucTypes.model.InferredTypes; import de.dhbwstuttgart.strucTypes.printutils.PrintConstraints; import de.dhbwstuttgart.strucTypes.printutils.PrintInferredTypes; import de.dhbwstuttgart.strucTypes.printutils.SyntaxTreePrinter;