Compare commits
10 Commits
fba7f0ee81
...
a84d1ffdd7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84d1ffdd7 | ||
|
|
a3d63a0266 | ||
|
|
dcc2da85c5 | ||
|
|
6f193b19ab | ||
| 1c55954e5c | |||
| ec04f01a10 | |||
|
|
78a2fddc21 | ||
|
|
44f8899157 | ||
|
|
d1a6dcbbac | ||
|
|
15150fca9e |
0
resources/bytecode/javFiles/Cycle.class
Executable file → Normal file
0
resources/bytecode/javFiles/Cycle.class
Executable file → Normal 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;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class CompilationEnvironment {
|
||||
ClassLoader classLoader = compiler.getClassLoader();
|
||||
List<Class> ret = new ArrayList<>();
|
||||
// Set classLoader to include default package for this specific source file
|
||||
File dir = sourceFile.getParentFile();
|
||||
File dir = sourceFile.getAbsoluteFile().getParentFile();
|
||||
String dirPath = dir.toString() + "/";
|
||||
if (packageName.length() > 0)
|
||||
dirPath = dirPath.substring(0, dirPath.length() - packageName.length() - 1);
|
||||
|
||||
@@ -445,6 +445,9 @@ public class SyntaxTreeGenerator {
|
||||
MethodblockContext methodblock = (MethodblockContext) body;
|
||||
block = stmtgen.convert(methodblock.block(), true);
|
||||
}
|
||||
else {
|
||||
modifiers += Modifier.ABSTRACT;
|
||||
}
|
||||
return new Method(modifiers, name, retType, paramlist, block, gtvDeclarations, bodydeclaration.getStart());
|
||||
}
|
||||
|
||||
|
||||
@@ -75,11 +75,12 @@ public class ConstraintSet<A> {
|
||||
|
||||
Constraint<B> newConst = as.stream()
|
||||
.map(o)
|
||||
.collect(Collectors.toCollection((as.getExtendConstraint() != null)
|
||||
? () -> new Constraint<B> (as.isInherited(),
|
||||
as.getExtendConstraint().stream().map(o).collect(Collectors.toCollection(Constraint::new)),
|
||||
as.getmethodSignatureConstraint().stream().map(o).collect(Collectors.toCollection(HashSet::new)))
|
||||
: () -> new Constraint<B> (as.isInherited())
|
||||
.collect(Collectors.toCollection((
|
||||
() -> new Constraint<B> (as.isInherited(),
|
||||
(as.getExtendConstraint() != null)
|
||||
? as.getExtendConstraint().stream().map(o).collect(Collectors.toCollection(Constraint::new))
|
||||
: null,
|
||||
as.getmethodSignatureConstraint().stream().map(o).collect(Collectors.toCollection(HashSet::new))))
|
||||
));
|
||||
|
||||
//CSA2CSB.put(as, newConst);
|
||||
|
||||
@@ -668,7 +668,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
.filter(x -> x.size()==1)
|
||||
.map(y -> y.stream().findFirst().get())
|
||||
.collect(Collectors.toCollection(HashSet::new)));
|
||||
|
||||
oneElems.forEach(x -> { if (x instanceof Constraint) methodSignatureConstraint.addAll(((Constraint<UnifyPair>)x).getmethodSignatureConstraint());});
|
||||
//optNextSet: Eine mehrelementige Menge, wenn vorhanden
|
||||
Optional<Set<? extends Set<UnifyPair>>> optNextSet = topLevelSets.stream().filter(x -> x.size()>1).findAny();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -234,6 +234,7 @@ public class TestComplete {
|
||||
}
|
||||
|
||||
@Test
|
||||
//@Ignore("This is to complex")
|
||||
public void matrixTest() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Matrix.jav");
|
||||
var matrix = classFiles.get("Matrix");
|
||||
@@ -740,7 +741,7 @@ public class TestComplete {
|
||||
@Test
|
||||
public void testLambdaRunnable() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "LambdaRunnable.jav");
|
||||
var clazz = classFiles.get("LamRunnable");
|
||||
var clazz = classFiles.get("LambdaRunnable");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
//var m = clazz.getDeclaredMethod("m", Integer.class);
|
||||
//assertEquals(m.invoke(instance, 10), 60);
|
||||
|
||||
Reference in New Issue
Block a user