diff --git a/compile.sh b/compile.sh index 9638a05..a234971 100755 --- a/compile.sh +++ b/compile.sh @@ -5,7 +5,7 @@ DESTDIR="out/src" TESTDESTDIR="out/tests" DEPENDENCIES="dependencies/*" JAVAC_FLAGS="-g:none -nowarn" -JAVATX_COMPILER_PATH="JavaTXcompiler" +JAVATX_COMPILER_PATH="JavaTXcompiler.jar" COMPILED_CLASSES="classes" #remove all files, if the script is called with parameter "clear" diff --git a/lib/dependencies/ST4-4.3.4.jar b/lib/dependencies/ST4-4.3.4.jar new file mode 100644 index 0000000..21a2f61 Binary files /dev/null and b/lib/dependencies/ST4-4.3.4.jar differ diff --git a/lib/dependencies/animal-sniffer-annotations-1.14.jar b/lib/dependencies/animal-sniffer-annotations-1.14.jar new file mode 100644 index 0000000..fb76acf Binary files /dev/null and b/lib/dependencies/animal-sniffer-annotations-1.14.jar differ diff --git a/lib/dependencies/antlr-runtime-3.5.3.jar b/lib/dependencies/antlr-runtime-3.5.3.jar new file mode 100644 index 0000000..0b06a7a Binary files /dev/null and b/lib/dependencies/antlr-runtime-3.5.3.jar differ diff --git a/lib/dependencies/antlr4-4.11.1.jar b/lib/dependencies/antlr4-4.11.1.jar new file mode 100644 index 0000000..b6d449d Binary files /dev/null and b/lib/dependencies/antlr4-4.11.1.jar differ diff --git a/lib/dependencies/antlr4-runtime-4.11.1.jar b/lib/dependencies/antlr4-runtime-4.11.1.jar new file mode 100644 index 0000000..7d57b59 Binary files /dev/null and b/lib/dependencies/antlr4-runtime-4.11.1.jar differ diff --git a/lib/dependencies/asm-9.5.jar b/lib/dependencies/asm-9.5.jar new file mode 100644 index 0000000..f5701dc Binary files /dev/null and b/lib/dependencies/asm-9.5.jar differ diff --git a/lib/dependencies/commons-io-2.6.jar b/lib/dependencies/commons-io-2.6.jar new file mode 100644 index 0000000..00556b1 Binary files /dev/null and b/lib/dependencies/commons-io-2.6.jar differ diff --git a/lib/dependencies/error_prone_annotations-2.0.18.jar b/lib/dependencies/error_prone_annotations-2.0.18.jar new file mode 100644 index 0000000..fa549b4 Binary files /dev/null and b/lib/dependencies/error_prone_annotations-2.0.18.jar differ diff --git a/lib/dependencies/guava-22.0.jar b/lib/dependencies/guava-22.0.jar new file mode 100644 index 0000000..fc7f316 Binary files /dev/null and b/lib/dependencies/guava-22.0.jar differ diff --git a/lib/dependencies/hamcrest-core-1.3.jar b/lib/dependencies/hamcrest-core-1.3.jar new file mode 100644 index 0000000..9d5fe16 Binary files /dev/null and b/lib/dependencies/hamcrest-core-1.3.jar differ diff --git a/lib/dependencies/icu4j-71.1.jar b/lib/dependencies/icu4j-71.1.jar new file mode 100644 index 0000000..7c5cb50 Binary files /dev/null and b/lib/dependencies/icu4j-71.1.jar differ diff --git a/lib/dependencies/j2objc-annotations-1.1.jar b/lib/dependencies/j2objc-annotations-1.1.jar new file mode 100644 index 0000000..4b6f127 Binary files /dev/null and b/lib/dependencies/j2objc-annotations-1.1.jar differ diff --git a/lib/dependencies/javassist-3.21.0-GA.jar b/lib/dependencies/javassist-3.21.0-GA.jar new file mode 100644 index 0000000..64549c4 Binary files /dev/null and b/lib/dependencies/javassist-3.21.0-GA.jar differ diff --git a/lib/dependencies/javax.json-1.1.4.jar b/lib/dependencies/javax.json-1.1.4.jar new file mode 100644 index 0000000..f6ca0cc Binary files /dev/null and b/lib/dependencies/javax.json-1.1.4.jar differ diff --git a/lib/dependencies/jsr305-1.3.9.jar b/lib/dependencies/jsr305-1.3.9.jar new file mode 100644 index 0000000..a9afc66 Binary files /dev/null and b/lib/dependencies/jsr305-1.3.9.jar differ diff --git a/lib/dependencies/junit-4.11.jar b/lib/dependencies/junit-4.11.jar new file mode 100644 index 0000000..aaf7444 Binary files /dev/null and b/lib/dependencies/junit-4.11.jar differ diff --git a/lib/dependencies/org.abego.treelayout.core-1.0.3.jar b/lib/dependencies/org.abego.treelayout.core-1.0.3.jar new file mode 100644 index 0000000..d78492b Binary files /dev/null and b/lib/dependencies/org.abego.treelayout.core-1.0.3.jar differ diff --git a/lib/dependencies/reflections-0.9.11.jar b/lib/dependencies/reflections-0.9.11.jar new file mode 100644 index 0000000..0f852c7 Binary files /dev/null and b/lib/dependencies/reflections-0.9.11.jar differ diff --git a/lib/resources/AllgemeinTest/Assign.jav b/lib/resources/AllgemeinTest/Assign.jav new file mode 100644 index 0000000..001fca7 --- /dev/null +++ b/lib/resources/AllgemeinTest/Assign.jav @@ -0,0 +1,10 @@ +class Assign { + + assign(x, y) { + x = y; + } + + assign2(x, y) { + assign(x,y); + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/CaptureConversion.jav b/lib/resources/AllgemeinTest/CaptureConversion.jav new file mode 100644 index 0000000..b1033de --- /dev/null +++ b/lib/resources/AllgemeinTest/CaptureConversion.jav @@ -0,0 +1,18 @@ +import java.lang.Object; +import java.util.Vector; + +class CaptureConversion { + + void assign(Vector v1, Vector v2) { + v1 = v2; + } + + void main() { + Vector v1; + v1 = new Vector(); + Vector v2; + v2 = new Vector(); + v1 = v2; + assign(v1, v2); + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/Complex.jav b/lib/resources/AllgemeinTest/Complex.jav new file mode 100644 index 0000000..15d5c5d --- /dev/null +++ b/lib/resources/AllgemeinTest/Complex.jav @@ -0,0 +1,22 @@ +class Pair { + U a; + T b; + Pair(U x, T y) { + a = x; b = y; + } +} + +class Complex { + m(b) { + var c = b; + var d = c; + var e; + d = e; + var r1 = e; + var f = e; + var g; + f = g; + var r2 = g; + return new Pair<>(r1, r2); + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/InfReturn.jav b/lib/resources/AllgemeinTest/InfReturn.jav new file mode 100644 index 0000000..d1f6211 --- /dev/null +++ b/lib/resources/AllgemeinTest/InfReturn.jav @@ -0,0 +1,7 @@ +public class InfReturn { + m(a) { + var ret; + a = ret; + return ret; + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/InfReturnII.jav b/lib/resources/AllgemeinTest/InfReturnII.jav new file mode 100644 index 0000000..e1e9597 --- /dev/null +++ b/lib/resources/AllgemeinTest/InfReturnII.jav @@ -0,0 +1,8 @@ +public class InfReturnII { + m(a, b) { + var ret; + a = ret; + b = ret; + return ret; + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/InnerInf.jav b/lib/resources/AllgemeinTest/InnerInf.jav new file mode 100644 index 0000000..4eaa183 --- /dev/null +++ b/lib/resources/AllgemeinTest/InnerInf.jav @@ -0,0 +1,7 @@ +class InnerInf { + m(a, b) { + var i; + a = i; + b = i; + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/Iteration.jav b/lib/resources/AllgemeinTest/Iteration.jav new file mode 100644 index 0000000..2af750a --- /dev/null +++ b/lib/resources/AllgemeinTest/Iteration.jav @@ -0,0 +1,43 @@ +/* +class Pair { + T x; + U y; + + public Pair() { } + public Pair(T x, U y) { + this.x = x; + this.y = y; + } + + public T fst () { + return x; + } + + public U snd () { + return y; + } +} +*/ + +public class Iteration { + id(x) { + return x; + } + + m1(x, y) { + var help; + help = m2(x, y); + var y2 = help.snd(); + var x2 = id(x); + return new Pair<>(x2,y2); + + } + + m2(x,y) { + var help = m1(x, y); + var x2 = help.fst(); + var y2 = id(y); + return new Pair<>(x2, y2); + } +} + \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/List.jav b/lib/resources/AllgemeinTest/List.jav new file mode 100644 index 0000000..9c612f2 --- /dev/null +++ b/lib/resources/AllgemeinTest/List.jav @@ -0,0 +1,46 @@ +import java.lang.Boolean; +import java.lang.Object; + +class List { + elem; + next; + + List() { + super(); + } + + List(elem, next) { + this.elem = elem; + this.next = next; + } + + addElement(newElem) { + return new List(newElem, this); + } + + append(l) { + if (next == null) { + return l; + } + else { + return new List(elem, next.append(l)); + } + } +/* + addAll(l) { + var nextLoc = next; + while (//nextLoc != null + true) { + nextLoc = nextLoc.next; + } + nextLoc = l; + } + + void m() { + List l; // = new List(1, null); + List l2; // = new List("SSS", null); + l.addAll(l2); + } +*/ +} + diff --git a/lib/resources/AllgemeinTest/Overloading.jav b/lib/resources/AllgemeinTest/Overloading.jav new file mode 100644 index 0000000..2809813 --- /dev/null +++ b/lib/resources/AllgemeinTest/Overloading.jav @@ -0,0 +1,7 @@ +import java.lang.Integer; +import java.lang.Double; + +class Overloading { + m(x) { return x + x; } + m(x) { return x || x; } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/Pair.jav b/lib/resources/AllgemeinTest/Pair.jav new file mode 100644 index 0000000..89660b1 --- /dev/null +++ b/lib/resources/AllgemeinTest/Pair.jav @@ -0,0 +1,36 @@ +import java.util.Vector; +import java.lang.Boolean; +import java.lang.Object; + +class Pair { + U a; + T b; + + make(x) { + var ret = new Pair<>(); + ret.a = x.elementAt(0); + ret.b = x.elementAt(1); + return ret; + } + + + eq(a, b) { + b = a; + return a == b; + } + + + compare( p) { + return eq(p.a, p.b); + //return p.a == p.b; + } + + +/* + void m(Pair p, Vector b) + { + //this.compare(p); //1, type incorrect + this.compare(this.make(b)); //2, OK + } +*/ +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/RecursionCond.jav b/lib/resources/AllgemeinTest/RecursionCond.jav new file mode 100644 index 0000000..1640471 --- /dev/null +++ b/lib/resources/AllgemeinTest/RecursionCond.jav @@ -0,0 +1,8 @@ +class RecursionCond { + m(a, b, c) { + if (1 == 2) { + b = m(a, b); + c = m(a, b); + } else return a; + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/StreamTest.jav b/lib/resources/AllgemeinTest/StreamTest.jav new file mode 100644 index 0000000..cfaf23d --- /dev/null +++ b/lib/resources/AllgemeinTest/StreamTest.jav @@ -0,0 +1,14 @@ +import java.util.stream.Stream; +import java.util.Vector; +import java.lang.Integer; + +class StreamTest { + + m() { + var vecInt = new Vector(); + var strInt = vecInt.stream(); + var dup = x -> x*2; + strInt.map(dup); + return dup; + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/Test.jav b/lib/resources/AllgemeinTest/Test.jav new file mode 100644 index 0000000..48491b8 --- /dev/null +++ b/lib/resources/AllgemeinTest/Test.jav @@ -0,0 +1,9 @@ +import java.lang.Boolean; +import java.lang.Integer; + +public class Test { + fac = (x) -> { + if (x == 1) { return 1; } + return x * fac.apply(x - 1); + }; +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/TripleTest.jav b/lib/resources/AllgemeinTest/TripleTest.jav new file mode 100644 index 0000000..a0560b6 --- /dev/null +++ b/lib/resources/AllgemeinTest/TripleTest.jav @@ -0,0 +1,19 @@ +class Triple { + U a; + T b; + S c; + + Triple(U x, T y, S z) { + a = x; b = y; c = z; + } + + U fst() { return a; } + T snd() { return b; } + S thrd() { return c; } +} + +public class TripleTest { + m() { + return new Triple<>(m().thrd(), m().thrd(), m().thrd()); + } +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/Twice2.jav b/lib/resources/AllgemeinTest/Twice2.jav new file mode 100644 index 0000000..87a3f23 --- /dev/null +++ b/lib/resources/AllgemeinTest/Twice2.jav @@ -0,0 +1,12 @@ +class Twice2 { + id1inst = new Id<>(); + id1 = id1inst.id; + id2inst = new Id<>(); + id2 = id2inst.id; + twice = id1.apply(id2); + +} + +class Id { + id = (T x) -> x; +} \ No newline at end of file diff --git a/lib/resources/AllgemeinTest/UseWildcardPair.jav b/lib/resources/AllgemeinTest/UseWildcardPair.jav new file mode 100644 index 0000000..dc91e4e --- /dev/null +++ b/lib/resources/AllgemeinTest/UseWildcardPair.jav @@ -0,0 +1,12 @@ +import java.util.Vector; +import java.lang.Boolean; + +class UseWildcardPair{ + + void m(Pair p, Vector b) + { + p.compare(p); //1, type incorrect + p.compare(p.make(b)); //2, OK + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/AA.jav b/lib/resources/bytecode/javFiles/AA.jav new file mode 100644 index 0000000..6b79df3 --- /dev/null +++ b/lib/resources/bytecode/javFiles/AA.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; +import java.lang.String; + +public class AA { + public m(Integer i) { return "AA"; } + + public m2(AA x) { return "AA"; } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Access.jav b/lib/resources/bytecode/javFiles/Access.jav new file mode 100644 index 0000000..46cd8c8 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Access.jav @@ -0,0 +1,14 @@ +public class Access { + public int fPublic; + int fDefault; + private int fPrivate; + protected int fProtected; + + public void mPublic() {} + void mDefault() {} + private void mPrivate() {} + protected void mProtected() {} +} + +class AccessDefault { +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/AddLong.jav b/lib/resources/bytecode/javFiles/AddLong.jav new file mode 100644 index 0000000..d6d47e9 --- /dev/null +++ b/lib/resources/bytecode/javFiles/AddLong.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; +import java.lang.Long; + +public class AddLong{ + Long add(Integer a, Long b) { + Long c = a+b; + return c; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Annotation.jav b/lib/resources/bytecode/javFiles/Annotation.jav new file mode 100644 index 0000000..520eb31 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Annotation.jav @@ -0,0 +1,8 @@ +class Base { + public void foo() {} +} + +public class Annotation extends Base { + @Override + public void foo() {} +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/AssignToLit.jav b/lib/resources/bytecode/javFiles/AssignToLit.jav new file mode 100644 index 0000000..873828e --- /dev/null +++ b/lib/resources/bytecode/javFiles/AssignToLit.jav @@ -0,0 +1,30 @@ +import java.lang.Integer; +import java.lang.Boolean; +import java.lang.String; +import java.lang.Byte; +import java.lang.Short; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; +import java.lang.Character; + +class AssignToLit { + void m(){ +// String s = "Test"; +// Boolean b = false; +// Byte byte1 = 5; +// Byte byte2 = 55; +// Short short1 = 5; +// Short short2 = 55; +// Integer int1 = 5; +// Integer int2 = 8888888; +// Long long1 = 1; +// Long long2 = 5; +// Long long3 = 89989898; +// Float float1 = 1; +// Float float2 = 55; +// Double d1 = 1; +// Double d2 = 55; + Character c = 'A'; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/BB.jav b/lib/resources/bytecode/javFiles/BB.jav new file mode 100644 index 0000000..db741c6 --- /dev/null +++ b/lib/resources/bytecode/javFiles/BB.jav @@ -0,0 +1,4 @@ +import java.lang.Integer; +import AA; + +public class BB extends AA { } \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/BinaryInMeth.jav b/lib/resources/bytecode/javFiles/BinaryInMeth.jav new file mode 100644 index 0000000..0e1ddc5 --- /dev/null +++ b/lib/resources/bytecode/javFiles/BinaryInMeth.jav @@ -0,0 +1,17 @@ +import java.lang.Integer; +import java.lang.Double; + +public class BinaryInMeth { + + public m(a){ + return ++a; + } + + public m2(a,b){ + return m(a+b); + } + + public m3(a) { + return m(++a); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Box.jav b/lib/resources/bytecode/javFiles/Box.jav new file mode 100644 index 0000000..4859d61 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Box.jav @@ -0,0 +1,7 @@ +class B { } +class Box_Main extends B { + m(b) { + b.m(new Box_Main()); + b.m(new B()); + } +} diff --git a/lib/resources/bytecode/javFiles/Box.java b/lib/resources/bytecode/javFiles/Box.java new file mode 100644 index 0000000..581e725 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Box.java @@ -0,0 +1,3 @@ +class Box { + void m(A a) { } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug112.jav b/lib/resources/bytecode/javFiles/Bug112.jav new file mode 100644 index 0000000..a3f1bad --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug112.jav @@ -0,0 +1,7 @@ +public class Bug112 { + public m(x) { + var y; + x = y; + return y; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug122.jav b/lib/resources/bytecode/javFiles/Bug122.jav new file mode 100644 index 0000000..746f311 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug122.jav @@ -0,0 +1,12 @@ +import java.lang.Integer; +import java.lang.Boolean; + +public class Bug122 { + public void main() { + if (true) { + for (Integer i = 0; i < 10; i++) { + + } + } + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug123.jav b/lib/resources/bytecode/javFiles/Bug123.jav new file mode 100644 index 0000000..daecc91 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug123.jav @@ -0,0 +1,13 @@ +import java.lang.Boolean; +import java.lang.Integer; + +public class Bug123 { + public Boolean works(){ + if(true) return true; + else return false; + } + public void fails(){ + Boolean a = true; + if(true) a = false; + } +} diff --git a/lib/resources/bytecode/javFiles/Bug125.jav b/lib/resources/bytecode/javFiles/Bug125.jav new file mode 100644 index 0000000..692106c --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug125.jav @@ -0,0 +1,16 @@ +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.LinkedList; +import java.util.ArrayList; + +public class Bug125 { + static ArrayList works = new ArrayList<>(); + static List fails = new ArrayList<>(); + + public void main() { + works.toString(); + fails.toString(); + } +} diff --git a/lib/resources/bytecode/javFiles/Bug285.jav b/lib/resources/bytecode/javFiles/Bug285.jav new file mode 100644 index 0000000..5f17b66 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug285.jav @@ -0,0 +1,15 @@ +import java.util.Optional; +import java.lang.Integer; + +public class StaticClass { + public static StaticClass barbar() { + return new StaticClass(); + } +} + +public class Bug285 { + public void foo() { + Optional opt = Optional.empty(); + StaticClass b = StaticClass.barbar(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug290A.jav b/lib/resources/bytecode/javFiles/Bug290A.jav new file mode 100644 index 0000000..7667cac --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug290A.jav @@ -0,0 +1,7 @@ +import Bug290B; + +public class Bug290A { + public void m() { + new Bug290B(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug290B.jav b/lib/resources/bytecode/javFiles/Bug290B.jav new file mode 100644 index 0000000..1a9201b --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug290B.jav @@ -0,0 +1,11 @@ +import java.lang.String; +import java.lang.Integer; + +public class Bug290B { + String name; + + public Bug290B() { + Integer i = 0; + name = i.toString() + "$$"; + } +} diff --git a/lib/resources/bytecode/javFiles/Bug293.jav b/lib/resources/bytecode/javFiles/Bug293.jav new file mode 100644 index 0000000..0e7dc26 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug293.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; +import java.lang.Float; + +public class Bug293 { + bar(a) { + return 2 * a; + } +} + +interface IFoo { + void ga(); +} + diff --git a/lib/resources/bytecode/javFiles/Bug295.jav b/lib/resources/bytecode/javFiles/Bug295.jav new file mode 100644 index 0000000..be4488a --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug295.jav @@ -0,0 +1,18 @@ +import java.lang.Integer; + +public class Bug295 { + public Integer a; + public Integer b; + public Integer c; + + public Bug295(a, b, c) { + this(a); + this.b = b; + this.c = c; + } + + public Bug295(a) { + this.a = a; + } +} + diff --git a/lib/resources/bytecode/javFiles/Bug296.jav b/lib/resources/bytecode/javFiles/Bug296.jav new file mode 100644 index 0000000..35ac882 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug296.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; + +public class Bug296 { + public static m1() { + return m2(); + } + + static m2() { + return 10; + } +} diff --git a/lib/resources/bytecode/javFiles/Bug297.jav b/lib/resources/bytecode/javFiles/Bug297.jav new file mode 100644 index 0000000..c4ff1e5 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug297.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; + +public class Bug297 { + public static operation(func, a, b) { + return func.apply(a, b); + } + + public exec() { + return Foo.operation((x, y) -> x + y, 10, 10); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug298.jav b/lib/resources/bytecode/javFiles/Bug298.jav new file mode 100644 index 0000000..42ff96a --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug298.jav @@ -0,0 +1,17 @@ +import java.util.List; +import java.util.ArrayList; +import java.lang.Integer; +import java.lang.System; +import java.lang.Boolean; +import java.io.PrintStream; +import java.util.stream.Stream; +import java.util.function.Function; + +public class Bug298 { + public void m() { + List list = new ArrayList<>(); + list.stream().map(x -> 2 * x); + + Function filter = x -> true; + } +} diff --git a/lib/resources/bytecode/javFiles/Bug300.jav b/lib/resources/bytecode/javFiles/Bug300.jav new file mode 100644 index 0000000..728aa3f --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug300.jav @@ -0,0 +1,17 @@ +import java.lang.String; + +class Base { + toString() { + return "Base"; + } +} + +public class Bug300 extends Base { + public m() { + return super.toString(); + } + + toString() { + return "Derived"; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug301.jav b/lib/resources/bytecode/javFiles/Bug301.jav new file mode 100644 index 0000000..30a6f2b --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug301.jav @@ -0,0 +1,4 @@ +import java.util.HashSet; + +public class Bug301 extends HashSet { +} diff --git a/lib/resources/bytecode/javFiles/Bug302.jav b/lib/resources/bytecode/javFiles/Bug302.jav new file mode 100644 index 0000000..baeb8a8 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug302.jav @@ -0,0 +1,11 @@ +import java.util.ArrayList; +import java.util.List; +import java.lang.Integer; + +public class Bug302 { + public Bug302(List a){} + + public static m() { + new Bug302(new ArrayList()); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug306.jav b/lib/resources/bytecode/javFiles/Bug306.jav new file mode 100644 index 0000000..d06ca67 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug306.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; +import java.util.List; + +class Base { + m(List a) {} +} + +public class Bug306 extends Base { + @Override + m(List b) { + b.add(1); + } +} diff --git a/lib/resources/bytecode/javFiles/Bug307.jav b/lib/resources/bytecode/javFiles/Bug307.jav new file mode 100644 index 0000000..482e356 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug307.jav @@ -0,0 +1,46 @@ +public class Bug307 { + public void main() { + IVisitor v = new Visitor(); + Impl2 f = new Impl2(); + Impl1 g = new Impl1(); + + f.accept(v); + g.accept(v); + } +} + +interface IVisitor { + void visit(Impl1 f); + void visit(Impl2 fb); +} + +interface IAcceptor { + void accept(IVisitor v); +} + +class Visitor implements IVisitor { + + @Override + public void visit(Impl1 f) { + } + + @Override + public void visit(Impl2 fb) { + } +} + +class Impl1 implements IAcceptor { + + @Override + public void accept(IVisitor v) { + v.visit(this); + } +} + +class Impl2 implements IAcceptor { + + @Override + public void accept(IVisitor v) { + v.visit(this); + } +} diff --git a/lib/resources/bytecode/javFiles/Bug309.jav b/lib/resources/bytecode/javFiles/Bug309.jav new file mode 100644 index 0000000..23ae44e --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug309.jav @@ -0,0 +1,16 @@ +import java.util.List; +import java.util.ArrayList; +import java.lang.Integer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.Optional; + +public class Bug309 { + public main() { + List list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9)); + var res = list.stream().filter(x -> x == 5).map(x -> x * 2).findFirst(); + return res; + } +} diff --git a/lib/resources/bytecode/javFiles/Bug310.jav b/lib/resources/bytecode/javFiles/Bug310.jav new file mode 100644 index 0000000..0539338 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug310.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; +import java.lang.String; + +public class Bug310 { + Integer i = 3; + public toString() { + return i.toString(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug311.jav b/lib/resources/bytecode/javFiles/Bug311.jav new file mode 100644 index 0000000..e8ccb7f --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug311.jav @@ -0,0 +1,10 @@ +import java.lang.String; + +public class Bug311 { + Bug311A i = new Bug311A(); + public toString() { + return i.toString(); + } +} + +class Bug311A {} diff --git a/lib/resources/bytecode/javFiles/Bug312.jav b/lib/resources/bytecode/javFiles/Bug312.jav new file mode 100644 index 0000000..82f1aa2 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug312.jav @@ -0,0 +1,8 @@ +public class Bug312 { + Bug312A i = new Bug312A(); + public main() { + if (i == null) {} + } +} + +class Bug312A {} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug314.jav b/lib/resources/bytecode/javFiles/Bug314.jav new file mode 100644 index 0000000..7f20d6d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug314.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; +import java.util.List; +import java.util.ArrayList; +import java.util.stream.Stream; +import java.util.function.Predicate; +import java.util.function.Function; +import java.util.stream.Collectors; + +public class Bug314 { + public List convert(List in) { + return in.stream().filter(x -> x > 5).collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug325.jav b/lib/resources/bytecode/javFiles/Bug325.jav new file mode 100644 index 0000000..6a3a29b --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug325.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; +import java.util.function.Function; +import java.util.List; +import java.util.ArrayList; +import java.util.stream.Stream; + +public class Bug325 { + public main() { + List list = new ArrayList<>(List.of(1,2,3,4,5)); + var func = x -> x*2; + return list.stream().map(func).toList(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug326.jav b/lib/resources/bytecode/javFiles/Bug326.jav new file mode 100644 index 0000000..6329fe6 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug326.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; + +public class Bug326 { + public Bug326() { + var func = x -> y -> x * y; + return func.apply(3).apply(4); + } +} diff --git a/lib/resources/bytecode/javFiles/Bug328.jav b/lib/resources/bytecode/javFiles/Bug328.jav new file mode 100644 index 0000000..c2cc1db --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug328.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; +import Bug328B; + +public class Bug328 extends Bug328B { + public Bug328() { + super(1); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Bug328B.java b/lib/resources/bytecode/javFiles/Bug328B.java new file mode 100644 index 0000000..1859d21 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug328B.java @@ -0,0 +1,3 @@ +public class Bug328B { + public Bug328B(int a) {} +} diff --git a/lib/resources/bytecode/javFiles/Bug98.jav b/lib/resources/bytecode/javFiles/Bug98.jav new file mode 100644 index 0000000..6a7a9e4 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Bug98.jav @@ -0,0 +1,16 @@ +import java.util.Vector; +import java.lang.Integer; +import java.lang.String; + +public class Bug98 { + + public m(x, y ,z) { + x = new Vector(); + y = new Vector(); + x.add(1); + y.add("2"); + //Integer i = x.elementAt(0); + //String s = y.elementAt(0); + return z.vectorAddAll(x, y); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/BugXXX.jav b/lib/resources/bytecode/javFiles/BugXXX.jav new file mode 100644 index 0000000..c25acdf --- /dev/null +++ b/lib/resources/bytecode/javFiles/BugXXX.jav @@ -0,0 +1,16 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.lang.String; +import java.util.stream.Stream; +import java.util.function.Function; +import java.util.function.Predicate; +import java.lang.Integer; + +class BugXXX { + public main() { + List i = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10)); + Optional tmp = i.stream().filter(x -> x == 5).map(x -> x*2).findFirst(); + return tmp; + } +} diff --git a/lib/resources/bytecode/javFiles/CC.jav b/lib/resources/bytecode/javFiles/CC.jav new file mode 100644 index 0000000..a19fd1f --- /dev/null +++ b/lib/resources/bytecode/javFiles/CC.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; +import java.lang.String; +import BB; + +public class CC extends BB { + public m(Integer i) { + return "CC"; + } + + public m2(CC x) { return "CC"; } +} diff --git a/lib/resources/bytecode/javFiles/Chain.jav b/lib/resources/bytecode/javFiles/Chain.jav new file mode 100644 index 0000000..bd43a01 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Chain.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; + +public class Chain { + x = 5; + + chain() { + return this; + } + + public m() { + return this.chain().chain().chain().x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/ClassGenLam.jav b/lib/resources/bytecode/javFiles/ClassGenLam.jav new file mode 100644 index 0000000..0e9cf05 --- /dev/null +++ b/lib/resources/bytecode/javFiles/ClassGenLam.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; + +public class ClassGenLam { + lam = x-> x; +// public ClassGenLam() { +// lam = x->x; +// } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Cycle.jav b/lib/resources/bytecode/javFiles/Cycle.jav new file mode 100644 index 0000000..b49e906 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Cycle.jav @@ -0,0 +1,6 @@ +public class Cycle { + public m(x, y) { + y = x; + x = y; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/DD.jav b/lib/resources/bytecode/javFiles/DD.jav new file mode 100644 index 0000000..07eaf7c --- /dev/null +++ b/lib/resources/bytecode/javFiles/DD.jav @@ -0,0 +1,5 @@ +import java.lang.Integer; +import CC; + +public class DD extends CC { } + diff --git a/lib/resources/bytecode/javFiles/DuMethod.jav b/lib/resources/bytecode/javFiles/DuMethod.jav new file mode 100644 index 0000000..3898a7b --- /dev/null +++ b/lib/resources/bytecode/javFiles/DuMethod.jav @@ -0,0 +1,11 @@ +public class DuMethod{ + + method(a){ + return a+a; + } + + method(a){ + return a; + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/EmptyClass.jav b/lib/resources/bytecode/javFiles/EmptyClass.jav new file mode 100644 index 0000000..8160d7d --- /dev/null +++ b/lib/resources/bytecode/javFiles/EmptyClass.jav @@ -0,0 +1,3 @@ +public class EmptyClass{ + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/EmptyMethod.jav b/lib/resources/bytecode/javFiles/EmptyMethod.jav new file mode 100644 index 0000000..961989d --- /dev/null +++ b/lib/resources/bytecode/javFiles/EmptyMethod.jav @@ -0,0 +1,8 @@ +public class EmptyMethod{ + + public void m1(){ + System.out.println("test"); + } + + public void m2(){} +} diff --git a/lib/resources/bytecode/javFiles/Example.jav b/lib/resources/bytecode/javFiles/Example.jav new file mode 100644 index 0000000..b7455a3 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Example.jav @@ -0,0 +1,9 @@ +import java.lang.String; + +public class Example { + + public m() { + String x = "X"; + return x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Exceptions.jav b/lib/resources/bytecode/javFiles/Exceptions.jav new file mode 100644 index 0000000..5b901ba --- /dev/null +++ b/lib/resources/bytecode/javFiles/Exceptions.jav @@ -0,0 +1,8 @@ +import java.lang.String; +import java.lang.RuntimeException; + +public class Exceptions { + public m() { + throw new RuntimeException("Some Exception"); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Expressions.jav b/lib/resources/bytecode/javFiles/Expressions.jav new file mode 100644 index 0000000..e2e992a --- /dev/null +++ b/lib/resources/bytecode/javFiles/Expressions.jav @@ -0,0 +1,8 @@ +class Expressions{ + +void test(){ + var x = 2; + x = x + 2; +} + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FC_Matrix.jav b/lib/resources/bytecode/javFiles/FC_Matrix.jav new file mode 100644 index 0000000..75ead47 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FC_Matrix.jav @@ -0,0 +1,10 @@ +import java.util.Vector; + +class Matrix extends Vector> { + + methode(m) { + m.add(1); + Matrix i; + methode(i); + } + } diff --git a/lib/resources/bytecode/javFiles/Fac.jav b/lib/resources/bytecode/javFiles/Fac.jav new file mode 100644 index 0000000..1e09235 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Fac.jav @@ -0,0 +1,15 @@ +import java.lang.Integer; +import java.lang.Double; +import java.lang.String; + +public class Fac { + getFac(n) { + var res = 1; + var i = 1; + while (i <= n) { + res = res * i; + i++; + } + return res; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Faculty.jav b/lib/resources/bytecode/javFiles/Faculty.jav new file mode 100644 index 0000000..276d8df --- /dev/null +++ b/lib/resources/bytecode/javFiles/Faculty.jav @@ -0,0 +1,52 @@ +import java.lang.Integer; +//import java.lang.Long; +//import java.lang.Short; + +public class Faculty { + public fact; + Faculty() { + fact = (x) -> { + if (x == 1) { + return 1; + } + else { + return x * (fact.apply(x-1)); + } + }; + } + + + + public getFact(java.lang.Integer x) { + return fact.apply(x); + } +} +// m (x) { +// +//// var fact = (x) -> { +//// if (x == 1) { +//// return x; +//// } +//// else { +//// return x * (fact.apply(x-1)); +//// } +//// }; +//// return fact; +//// var x = 13; +//// if(x>22) { +//// return 0; +//// }else if(x <1){ +//// return x; +//// }else { +//// return 1; +//// } +// +// if (x < 0) { +// return 0; +// }else if(x<2) { +// return x; +// } else { +// return x * m(x-1); +// } +// } +//} diff --git a/lib/resources/bytecode/javFiles/Faculty2.jav b/lib/resources/bytecode/javFiles/Faculty2.jav new file mode 100644 index 0000000..828f06f --- /dev/null +++ b/lib/resources/bytecode/javFiles/Faculty2.jav @@ -0,0 +1,10 @@ +class Faculty2 { + + m () { + + var fact = (Integer x) -> { + return x; + }; + return fact; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FacultyIf.jav b/lib/resources/bytecode/javFiles/FacultyIf.jav new file mode 100644 index 0000000..3c36892 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FacultyIf.jav @@ -0,0 +1,17 @@ +import java.lang.Integer; + +class Faculty { + + m () { + + var fact = (Integer x) -> { + if (x == 1) { + return x; + } + else { + return x * (fact.apply(x-1)); + } + }; + return fact; + } +} diff --git a/lib/resources/bytecode/javFiles/FacultyTyped.jav b/lib/resources/bytecode/javFiles/FacultyTyped.jav new file mode 100644 index 0000000..089d2f3 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FacultyTyped.jav @@ -0,0 +1,19 @@ +import java.lang.Integer; + +class Faculty { + + Integer mul(Integer x, Integer y) { + return x; + } + + Fun1 m () { + var fact = (Integer x) -> { + return mul(x, fact.apply(x)); + }; + return fact; + } +} + +interface Fun1{ + B apply(A a); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Field.jav b/lib/resources/bytecode/javFiles/Field.jav new file mode 100644 index 0000000..0fd1133 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Field.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; + +public class Field { + public x = 5; + + m(){ + return x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FieldAccess.jav b/lib/resources/bytecode/javFiles/FieldAccess.jav new file mode 100644 index 0000000..894bb6e --- /dev/null +++ b/lib/resources/bytecode/javFiles/FieldAccess.jav @@ -0,0 +1,13 @@ +class Box { +A f; +} +class B { + } + +class Box_Main extends B { + + m(b) { + b.f = new Box_Main(); + b.f = new B(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FieldTph.jav b/lib/resources/bytecode/javFiles/FieldTph.jav new file mode 100644 index 0000000..fc74e53 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FieldTph.jav @@ -0,0 +1,4 @@ +public class FieldTph { + a; + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FieldTph2.jav b/lib/resources/bytecode/javFiles/FieldTph2.jav new file mode 100644 index 0000000..21d9445 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FieldTph2.jav @@ -0,0 +1,14 @@ +import java.lang.String; + +public class FieldTph2 { + public a; + + public m(b){ + b = a; + return b; + } + + public m2(c){ + a = c; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FieldTphConsMeth.jav b/lib/resources/bytecode/javFiles/FieldTphConsMeth.jav new file mode 100644 index 0000000..e8d01c1 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FieldTphConsMeth.jav @@ -0,0 +1,26 @@ +public class FieldTphConsMeth { + + public a; + public FieldTphConsMeth(c) { + a = id(c); + } + + public id(b) { + return b; + } + + public setA(x) { + a = x; + return a; + } + + public m(x,y) { + x = id(y); + } + + /*m2(x,y) { + x = setA(y); + return x; + }*/ + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FieldTphMMeth.jav b/lib/resources/bytecode/javFiles/FieldTphMMeth.jav new file mode 100644 index 0000000..e1277bf --- /dev/null +++ b/lib/resources/bytecode/javFiles/FieldTphMMeth.jav @@ -0,0 +1,27 @@ +import java.lang.Boolean; + +public class FieldTphMMeth { + public a; + + public FieldTphMMeth(c,d,e) { + a = m(c,d,e); + } + + public m(b,d,e) { + if(e) { + return m3(b); + } else{ + return m3(d); + } + + } + + public m2(b) { + a = m3(b); + } + + public m3(b){ + return b; + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Fields.jav b/lib/resources/bytecode/javFiles/Fields.jav new file mode 100644 index 0000000..cd2add7 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Fields.jav @@ -0,0 +1,11 @@ +import java.lang.String; + +class Fields{ +test2 = "test"; +test; +m(){ + var test3; + return test; +} + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/For.jav b/lib/resources/bytecode/javFiles/For.jav new file mode 100644 index 0000000..e96184e --- /dev/null +++ b/lib/resources/bytecode/javFiles/For.jav @@ -0,0 +1,30 @@ +import java.lang.Integer; +import java.lang.Boolean; + +public class For{ + public Integer m(Integer x){ + var c = x + 2; + Boolean b = true; + c = 5; + c++; + ++c; + c--; + --c; + while(x<2){ + x = x +1; + b = false; + } + for(int i = 0; i<10; i++) { + x = x + 5; + } + return x; + } + +// m2(Integer x){ +// if(x<2) { +// return 1; +// }else { +// return 2; +// } +// } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/ForEach.jav b/lib/resources/bytecode/javFiles/ForEach.jav new file mode 100644 index 0000000..301066a --- /dev/null +++ b/lib/resources/bytecode/javFiles/ForEach.jav @@ -0,0 +1,23 @@ +import java.util.ArrayList; +import java.lang.Integer; +import java.lang.Number; + +public class ForEach { + public m() { + var list = new ArrayList<>(); + list.add(1); list.add(2); list.add(3); + + var sum = 0; + for (var i : list) { + sum = sum + i; + } + return sum; + } + + public m2() { + var list = new ArrayList(); + + for (Number n : list) { + } + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/FunOL.jav b/lib/resources/bytecode/javFiles/FunOL.jav new file mode 100644 index 0000000..60736e1 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FunOL.jav @@ -0,0 +1,12 @@ +import java.util.Vector; +import java.lang.Integer; +import java.lang.String; +//import java.lang.Byte; +//import java.lang.Boolean; + +public class FunOL { + + add(f, y) { + return f.apply() + y; + } +} diff --git a/lib/resources/bytecode/javFiles/FunctionalInterface.jav b/lib/resources/bytecode/javFiles/FunctionalInterface.jav new file mode 100644 index 0000000..39b3b34 --- /dev/null +++ b/lib/resources/bytecode/javFiles/FunctionalInterface.jav @@ -0,0 +1,15 @@ +import java.lang.Integer; +import java.util.function.Function; + +public class FunctionalInterface { + Integer accept(Function f) { + return f.apply(20); + } + + public Integer m() { + var v = accept(i -> { + return i * 10; + }); + return v; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Gen.jav b/lib/resources/bytecode/javFiles/Gen.jav new file mode 100644 index 0000000..3b58b18 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Gen.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; +import java.util.Vector; + +public class Gen{ + Vector m(Vector v){ + return v; + } +} diff --git a/lib/resources/bytecode/javFiles/Generics.jav b/lib/resources/bytecode/javFiles/Generics.jav new file mode 100644 index 0000000..bb7b2af --- /dev/null +++ b/lib/resources/bytecode/javFiles/Generics.jav @@ -0,0 +1,17 @@ + +class Generics { + Generics(B b){ + } + B mt1(B b){ + return mt1(b); + } +} + + +/* +Problem: +auto test = new List(); +auto test2 = new List(); +... //code, welcher möglicherweise test und test2 vertauscht +test.add("hallo"); +*/ \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Generics2.jav b/lib/resources/bytecode/javFiles/Generics2.jav new file mode 100644 index 0000000..f3aa144 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Generics2.jav @@ -0,0 +1,9 @@ +import java.lang.String; +import java.lang.Integer; + +public class Generics2{ + public X m1(X b){ + return b; + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Generics3.jav b/lib/resources/bytecode/javFiles/Generics3.jav new file mode 100644 index 0000000..fb354d4 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Generics3.jav @@ -0,0 +1,7 @@ +import java.lang.String; +import java.lang.Integer; +import java.util.List; + +class Generics3> { + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Generics4.jav b/lib/resources/bytecode/javFiles/Generics4.jav new file mode 100644 index 0000000..50b0b3e --- /dev/null +++ b/lib/resources/bytecode/javFiles/Generics4.jav @@ -0,0 +1,12 @@ +import java.lang.String; +import java.lang.Integer; + +class Generics4 { + C m1(C b){ + return b; + } + + m2(x) { + return m1(x); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/GreaterEqual.jav b/lib/resources/bytecode/javFiles/GreaterEqual.jav new file mode 100644 index 0000000..3ec69e8 --- /dev/null +++ b/lib/resources/bytecode/javFiles/GreaterEqual.jav @@ -0,0 +1,57 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; + +public class GreaterEqual { + + gE(Integer a, Integer b){ + var c = a>=b; + return c; + } + + gE(Long a, Long b){ + var c = a>=b; + return c; + } + + gE(Float a, Float b){ + var c = a>=b; + return c; + } + + gE(Double a, Double b){ + var c = a>=b; + return c; + } + + gE(Long a, Integer b){ + var c = a>=b; + return c; + } + + gE(Float a, Integer b){ + var c = a>=b; + return c; + } + + gE(Double a, Integer b){ + var c = a>=b; + return c; + } + + gE(Float a, Long b){ + var c = a>=b; + return c; + } + + gE(Double a, Long b){ + var c = a>=b; + return c; + } + + gE(Double a, Float b){ + var c = a>=b; + return c; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/GreaterThan.jav b/lib/resources/bytecode/javFiles/GreaterThan.jav new file mode 100644 index 0000000..9077f5b --- /dev/null +++ b/lib/resources/bytecode/javFiles/GreaterThan.jav @@ -0,0 +1,56 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; + +public class GreaterThan { + gT(Integer a, Integer b){ + var c = a>b; + return c; + } + + gT(Long a, Long b){ + var c = a>b; + return c; + } + + gT(Float a, Float b){ + var c = a>b; + return c; + } + + gT(Double a, Double b){ + var c = a>b; + return c; + } + + gT(Long a, Integer b){ + var c = a>b; + return c; + } + + gT(Float a, Integer b){ + var c = a>b; + return c; + } + + gT(Double a, Integer b){ + var c = a>b; + return c; + } + + gT(Float a, Long b){ + var c = a>b; + return c; + } + + gT(Double a, Long b){ + var c = a>b; + return c; + } + + gT(Double a, Float b){ + var c = a>b; + return c; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/HelloWorld.jav b/lib/resources/bytecode/javFiles/HelloWorld.jav new file mode 100644 index 0000000..7f5f75d --- /dev/null +++ b/lib/resources/bytecode/javFiles/HelloWorld.jav @@ -0,0 +1,9 @@ +import java.lang.System; +import java.lang.String; +import java.io.PrintStream; + +public class HelloWorld { + public static hello() { + System.out.println("Hello World!"); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Id.jav b/lib/resources/bytecode/javFiles/Id.jav new file mode 100644 index 0000000..f31991d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Id.jav @@ -0,0 +1,20 @@ +public class Id { +// a; +// id(b){ +// return b; +// } + id2 = x -> x; +// id2 = () -> { +// var x = m(a); +// var y = x; +// var z = y; +// }; +// +// m(a){ +// return a; +// } + id3 (x) { + return id2.apply(x); + } +} + diff --git a/lib/resources/bytecode/javFiles/IfTest.jav b/lib/resources/bytecode/javFiles/IfTest.jav new file mode 100644 index 0000000..bbcda96 --- /dev/null +++ b/lib/resources/bytecode/javFiles/IfTest.jav @@ -0,0 +1,15 @@ +import java.lang.Integer; +import java.lang.Boolean; +import java.lang.String; + +public class IfTest{ + Integer m1(Boolean b) { + Integer i; + String b; + if(b) { + return i; + }else{ + return b; + } + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Import.jav b/lib/resources/bytecode/javFiles/Import.jav new file mode 100644 index 0000000..c658568 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Import.jav @@ -0,0 +1,8 @@ +import java.util.Vector; + +class Import { + void methode(){ + Vector v = new Vector<>(); + v.add("X"); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Inf.jav b/lib/resources/bytecode/javFiles/Inf.jav new file mode 100644 index 0000000..6002994 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Inf.jav @@ -0,0 +1,65 @@ +public class Inf { + m(x,y,a){ + var z; + var v; + var w; + var b; + y=x; + z=x; + v=y; + w=y; + y=a; + b=a; + var c; + var d; + c = v; + d = v; + } +} + +/* +TPH M m(TPH N x, TPH O y, TPH P a)({ + TPH Q z; + TPH R v; + TPH S w; + TPH T b; + (y)::TPH O = (x)::TPH N; + (z)::TPH Q = (x)::TPH N; + (v)::TPH R = (y)::TPH O; + (w)::TPH S = (y)::TPH O; + (y)::TPH O = (a)::TPH P; + (b)::TPH T = (a)::TPH P; + TPH U c; + TPH V d; + (c)::TPH U = (v)::TPH R; + (d)::TPH V = (v)::TPH R; + return; +})::TPH W + + Inf()({ + super(()); + })::TPH Z + +} +// c::U d::V +// \ / +// v::R w::S +// \ / +// z::Q y::O b::T +// \ / \ / +// x::N a::P + +RESULT Final: [[(TPH N < TPH O), (TPH R < TPH V), (TPH N < TPH Q), (TPH P < TPH O), (TPH R < TPH U), (TPH M = void), (TPH O < TPH S), (TPH O < TPH R), (TPH P < TPH T)]] +Simplified constraints: [(TPH O < TPH S), (TPH P < TPH O), (TPH O < TPH R), (TPH P < TPH T), (TPH N < TPH O), (TPH N < TPH Q)] +m: [(TPH DDV = java.lang.Object), (TPH DDX = java.lang.Object), (TPH DDX < TPH DDV), (TPH N < TPH DDX), (TPH P < TPH DDX)] +Class Inf: [] +Inf: [] + +Unify nach Oder-Constraints-Anpassung: +UND:[(void =. M, , -1 WC: false, IT: false), (N <. O, 1 WC: false, IT: false, 1 WC: false, IT: false), (P <. O, 1 WC: false, IT: false, 1 WC: false, IT: false), (N <. Q, 1 WC: false, IT: false, 0 WC: true, IT: false), (O <. S, 1 WC: false, IT: false, 0 WC: true, IT: false), (O <. R, 1 WC: false, IT: false, 0 WC: true, IT: false), (P <. T, 1 WC: false, IT: false, 0 WC: true, IT: false)] +isInherited = false +isStatement = false + +ODER: +*/ + diff --git a/lib/resources/bytecode/javFiles/Infimum.jav b/lib/resources/bytecode/javFiles/Infimum.jav new file mode 100644 index 0000000..7c47539 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Infimum.jav @@ -0,0 +1,6 @@ +class Infimum { + m(x, y, z) { + y = x; + z = x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Inherit.jav b/lib/resources/bytecode/javFiles/Inherit.jav new file mode 100644 index 0000000..8808d8c --- /dev/null +++ b/lib/resources/bytecode/javFiles/Inherit.jav @@ -0,0 +1,21 @@ +import java.util.Vector; + +import java.lang.Integer; +import java.lang.String; +import AA; +import BB; +import CC; +import DD; + +public class Inherit { + + public main(d, i) { + return d.m(i); + } + + public main(v, i) { + var aa = v.elementAt(0); + return aa.m(i); + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Inherit2.jav b/lib/resources/bytecode/javFiles/Inherit2.jav new file mode 100644 index 0000000..58a6ebb --- /dev/null +++ b/lib/resources/bytecode/javFiles/Inherit2.jav @@ -0,0 +1,20 @@ +import java.util.Vector; + +import java.lang.Integer; +import java.lang.String; +import AA; +import BB; +import CC; +import DD; + +public class Inherit2 { + + public main(d) { + return d.m2(d); + } + + public main(v) { + var aa = v.elementAt(0); + return aa.m2(aa); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/InstanceOf.jav b/lib/resources/bytecode/javFiles/InstanceOf.jav new file mode 100644 index 0000000..52a7473 --- /dev/null +++ b/lib/resources/bytecode/javFiles/InstanceOf.jav @@ -0,0 +1,18 @@ +import java.lang.Object; +import java.lang.Integer; +import java.lang.Boolean; + +interface Interface {} + +class Test implements Interface { +} +class Test2 { +} + +public class InstanceOf { + a = new Test(); + + public test1() { return this.a instanceof Test; } + public test2() { return this.a instanceof Interface; } + public test3() { return this.a instanceof Integer; } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Interface1.jav b/lib/resources/bytecode/javFiles/Interface1.jav new file mode 100644 index 0000000..b741819 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Interface1.jav @@ -0,0 +1,3 @@ +public interface Interface1{ + public void test(); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Interfaces.jav b/lib/resources/bytecode/javFiles/Interfaces.jav new file mode 100644 index 0000000..0c4cd21 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Interfaces.jav @@ -0,0 +1,33 @@ +import java.lang.Integer; + +interface A { + void method1(); + default method2() { + } +} + +interface B { + void method3(); +} + +interface C { + Integer myInt(); +} + +class ClassX implements A { +} + +record ClassY(Integer myInt) implements C {} + +public class Interfaces implements A, B { + public void method1() { + } + public void method3() { + var intf = new Interfaces(); + intf = new ClassX(); + intf.method1(); + + C c = new ClassY(10); + c.myInt(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/KompTph.jav b/lib/resources/bytecode/javFiles/KompTph.jav new file mode 100644 index 0000000..ec34e15 --- /dev/null +++ b/lib/resources/bytecode/javFiles/KompTph.jav @@ -0,0 +1,13 @@ +public class KompTph { + public m(a, b, c) { + var d = a; + var e = a; + a = b; + c = b; + m2(a,c); + } + + public m2(a,b){ + m(a,a,b); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/LamRunnable.jav b/lib/resources/bytecode/javFiles/LamRunnable.jav new file mode 100644 index 0000000..d0da84c --- /dev/null +++ b/lib/resources/bytecode/javFiles/LamRunnable.jav @@ -0,0 +1,16 @@ +import java.lang.Runnable; +import java.lang.System; +import java.lang.String; +import java.io.PrintStream; + +public class LamRunnable { + + public LamRunnable() { + Runnable lam = () -> { + System.out.println("lambda"); + }; + + lam.run(); + } +} + \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Lambda.jav b/lib/resources/bytecode/javFiles/Lambda.jav new file mode 100644 index 0000000..2e725bf --- /dev/null +++ b/lib/resources/bytecode/javFiles/Lambda.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; + +public class Lambda { + + public m() { + var lam1 = (x) -> { + return x; + }; + return lam1; + } +} diff --git a/lib/resources/bytecode/javFiles/Lambda2.jav b/lib/resources/bytecode/javFiles/Lambda2.jav new file mode 100644 index 0000000..92f32b7 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Lambda2.jav @@ -0,0 +1,35 @@ +import java.lang.String; + +public class Lambda2 +{ + public static void main(List args){ + var listOfStrings = new List(); + var listOfObjects; + listOfObjects = map(listOfStrings, (a) -> a); +} + +public map(a , b){ + b.apply(a); + return a; +} + +/* +public static List map(List input, Function func) { + List output; + output = new List(); + output.add(func.apply(input.get())); + return output; +} +*/ +} + +class List{ + /* A get(); + void add(A); + */ +} +/* +class Function{ + B apply(A a); +} +*/ \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Lambda3.jav b/lib/resources/bytecode/javFiles/Lambda3.jav new file mode 100644 index 0000000..9c4e960 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Lambda3.jav @@ -0,0 +1,23 @@ + +public class Lambda2 +{ + /* + public static List map(List input, + Function func){ + input.add(func.apply(input.get())); + } + */ + public map(input,func){ + input.add(func.apply(input.get())); + return map(new List(), func); + } +} + +class List{ + A get(); + void add(A); +} + +class Function{ + B apply(A a); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Lambda4.jav b/lib/resources/bytecode/javFiles/Lambda4.jav new file mode 100644 index 0000000..378eb4d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Lambda4.jav @@ -0,0 +1,18 @@ +class Lambda{ + +methode(){ + return ((f) -> f); +} +} +/* +interface Fun0{ + A apply(); +} + +interface Fun1{ + A apply(B b); +} +*/ +interface Fun2{ + A apply(B b, C c); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/LambdaCapture.jav b/lib/resources/bytecode/javFiles/LambdaCapture.jav new file mode 100644 index 0000000..ab1751f --- /dev/null +++ b/lib/resources/bytecode/javFiles/LambdaCapture.jav @@ -0,0 +1,12 @@ +import java.lang.Integer; +public class LambdaCapture { + Integer i = 8; + f; + public LambdaCapture(){ + Integer w = 7; + f = j ->{ + return w+i;}; + + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/LambdaField.jav b/lib/resources/bytecode/javFiles/LambdaField.jav new file mode 100644 index 0000000..4eb5373 --- /dev/null +++ b/lib/resources/bytecode/javFiles/LambdaField.jav @@ -0,0 +1,6 @@ +public class LambdaField { + + f = x -> x; + +} + diff --git a/lib/resources/bytecode/javFiles/LambdaRunnable.jav b/lib/resources/bytecode/javFiles/LambdaRunnable.jav new file mode 100644 index 0000000..9dff3a8 --- /dev/null +++ b/lib/resources/bytecode/javFiles/LambdaRunnable.jav @@ -0,0 +1,17 @@ +import java.lang.Runnable; +import java.lang.String; +import java.lang.System; +import java.io.PrintStream; + +public class LambdaRunnable { + + public LambdaRunnable(){ + + + Runnable lam = () -> { + System.out.println("Runnable is running"); + }; + lam.run(); + } +} + diff --git a/lib/resources/bytecode/javFiles/LambdaVoid.jav b/lib/resources/bytecode/javFiles/LambdaVoid.jav new file mode 100644 index 0000000..dc16fcb --- /dev/null +++ b/lib/resources/bytecode/javFiles/LambdaVoid.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; + +public class Lambda { + + m () { + var lam1 = (x) -> { }; + return lam1; + } +} diff --git a/lib/resources/bytecode/javFiles/LessEqual.jav b/lib/resources/bytecode/javFiles/LessEqual.jav new file mode 100644 index 0000000..02714fc --- /dev/null +++ b/lib/resources/bytecode/javFiles/LessEqual.jav @@ -0,0 +1,56 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; + +public class LessEqual { + public lessEqual(Integer a, Integer b){ + var c = a<=b; + return c; + } + + public lessEqual(Long a, Long b){ + var c = a<=b; + return c; + } + + public lessEqual(Float a, Float b){ + var c = a<=b; + return c; + } + + public lessEqual(Double a, Double b){ + var c = a<=b; + return c; + } + + public lessEqual(Long a, Integer b){ + var c = a<=b; + return c; + } + + public lessEqual(Float a, Integer b){ + var c = a<=b; + return c; + } + + public lessEqual(Double a, Integer b){ + var c = a<=b; + return c; + } + + public lessEqual(Float a, Long b){ + var c = a<=b; + return c; + } + + public lessEqual(Double a, Long b){ + var c = a<=b; + return c; + } + + public lessEqual(Double a, Float b){ + var c = a<=b; + return c; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/LessThan.jav b/lib/resources/bytecode/javFiles/LessThan.jav new file mode 100644 index 0000000..a4c5be9 --- /dev/null +++ b/lib/resources/bytecode/javFiles/LessThan.jav @@ -0,0 +1,57 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; + +public class LessThan { + + public lessThan(Integer a, Integer b){ + var c = a> { + + Matrix () { + } + + public Matrix(vv) { + Integer i; + i = 0; + while(i < vv.size()) { +// Boolean a = this.add(vv.elementAt(i)); + this.add(vv.elementAt(i)); + i=i+1; + } + } + + public mul(m) { + var ret = new Matrix(); + var i = 0; + while(i < size()) { + var v1 = this.elementAt(i); + var v2 = new Vector(); + var j = 0; + while(j < v1.size()) { + var erg = 0; + var k = 0; + while(k < v1.size()) { + erg = erg + v1.get(k) + * m.get(k).get(j); + k++; } +// v2.addElement(new Integer(erg)); + v2.addElement(erg); + j++; } + ret.addElement(v2); + i++; + } + return ret; + } +} diff --git a/lib/resources/bytecode/javFiles/MatrixOP.jav b/lib/resources/bytecode/javFiles/MatrixOP.jav new file mode 100644 index 0000000..749f208 --- /dev/null +++ b/lib/resources/bytecode/javFiles/MatrixOP.jav @@ -0,0 +1,43 @@ +import java.util.Vector; +import java.lang.Integer; +//import java.lang.Byte; +import java.lang.Boolean; + +public class MatrixOP extends Vector> { + + MatrixOP () { + } + + public MatrixOP(vv) { + Integer i; + i = 0; + while(i < vv.size()) { +// Boolean a = this.add(vv.elementAt(i)); + this.add(vv.elementAt(i)); + i=i+1; + } + } + + public mul = (m1, m2) -> { + var ret = new MatrixOP(); + var i = 0; + while(i < m1.size()) { + var v1 = m1.elementAt(i); + var v2 = new Vector(); + var j = 0; + while(j < v1.size()) { + var erg = 0; + var k = 0; + while(k < v1.size()) { + erg = erg + v1.elementAt(k) + * m2.elementAt(k).elementAt(j); + k++; } +// v2.addElement(new Integer(erg)); + v2.addElement(erg); + j++; } + ret.addElement(v2); + i++; + } + return ret; + }; +} diff --git a/lib/resources/bytecode/javFiles/Merge.jav b/lib/resources/bytecode/javFiles/Merge.jav new file mode 100644 index 0000000..c25c00a --- /dev/null +++ b/lib/resources/bytecode/javFiles/Merge.jav @@ -0,0 +1,20 @@ +import java.util.List; +import java.lang.Integer; +//import java.util.Collection; + +public class Merge { + + public merge(a, b) { + a.addAll(b); + return a; + } + + + + public sort(in){ + var firstHalf = in.subList(1,2); + var secondHalf = in.subList(1,2); + return merge(sort(firstHalf), sort(secondHalf)); + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Meth_Gen.jav b/lib/resources/bytecode/javFiles/Meth_Gen.jav new file mode 100644 index 0000000..056dd82 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Meth_Gen.jav @@ -0,0 +1,11 @@ +class Meth_Gen { + + m1(x, y) { + m2(x); + x = y; + } + + m2(y) { + m1(y, y); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/MethodCallGenerics.jav b/lib/resources/bytecode/javFiles/MethodCallGenerics.jav new file mode 100644 index 0000000..0d02509 --- /dev/null +++ b/lib/resources/bytecode/javFiles/MethodCallGenerics.jav @@ -0,0 +1,14 @@ +import java.lang.String; + +class Generics { + // A mt1(A a, B b){ + B mt1(B a, B b){ + return mt1(a, a); + } +} + +class Test { + methode(String s){ + return new Generics().mt1(s,s); + } +} diff --git a/lib/resources/bytecode/javFiles/MethodWildcardGen.jav b/lib/resources/bytecode/javFiles/MethodWildcardGen.jav new file mode 100644 index 0000000..c982c44 --- /dev/null +++ b/lib/resources/bytecode/javFiles/MethodWildcardGen.jav @@ -0,0 +1,21 @@ +/* +class C{ + A f; + m(b, c){ + c.f = b; + c.m(b, c); + } +} +*/ +class C{ + X f; + m(b, c, d){ + this.f = b; + this.f = c.f; + c.m2(d); + } + + m2(a){ + a.f = this.f; + } +} diff --git a/lib/resources/bytecode/javFiles/Methods.jav b/lib/resources/bytecode/javFiles/Methods.jav new file mode 100644 index 0000000..3c46739 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Methods.jav @@ -0,0 +1,14 @@ +import java.lang.Integer; + +class Methods { + + m(a,b){ + var c=a+b; + return c; + } + + method2(x){ + Integer i = this.m(x,2); + return i; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/MethodsEasy.jav b/lib/resources/bytecode/javFiles/MethodsEasy.jav new file mode 100644 index 0000000..ee6f9da --- /dev/null +++ b/lib/resources/bytecode/javFiles/MethodsEasy.jav @@ -0,0 +1,7 @@ + +class Methods { + mt4(a,b,c) { return a.mt3(b).mt3(c) ; } + + mt3(a) {return a.mt3(a); } +} + diff --git a/lib/resources/bytecode/javFiles/OL.jav b/lib/resources/bytecode/javFiles/OL.jav new file mode 100644 index 0000000..a30edca --- /dev/null +++ b/lib/resources/bytecode/javFiles/OL.jav @@ -0,0 +1,16 @@ +import java.lang.Double; +import java.lang.String; +import java.lang.Long; +import java.lang.Integer; + +public class OL { + public m (x) { return x + x; } +} + +public class OLMain { + public main(x) { + var ol; + ol = new OL(); + return ol.m(x); + } +} diff --git a/lib/resources/bytecode/javFiles/OLConstructor.jav b/lib/resources/bytecode/javFiles/OLConstructor.jav new file mode 100644 index 0000000..1e31509 --- /dev/null +++ b/lib/resources/bytecode/javFiles/OLConstructor.jav @@ -0,0 +1,17 @@ +import java.lang.Integer; + +public class Parent { + public Integer x; + + public Parent(Integer a) { + this.x = a; + } + + public Parent() {} +} + +public class Child extends Parent { + public Child() { + super(3); + } +} diff --git a/lib/resources/bytecode/javFiles/OLFun.jav b/lib/resources/bytecode/javFiles/OLFun.jav new file mode 100644 index 0000000..50d30b7 --- /dev/null +++ b/lib/resources/bytecode/javFiles/OLFun.jav @@ -0,0 +1,19 @@ +import java.lang.String; +import java.lang.Integer; +import java.lang.Double; +import java.util.Vector; +import java.lang.Boolean; + +public class OLFun { + + //f = x -> {return x + x;}; + m(f, x) { + x = f.apply(x+x); + return x; + } + + m2(y) { + m(x -> x * 2, y); + return; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/OLFun2.jav b/lib/resources/bytecode/javFiles/OLFun2.jav new file mode 100644 index 0000000..6b6f38a --- /dev/null +++ b/lib/resources/bytecode/javFiles/OLFun2.jav @@ -0,0 +1,13 @@ +import java.lang.String; +import java.lang.Integer; +import java.lang.Double; +import java.util.Vector; +import java.lang.Boolean; + +public class OLFun2 { + + x; + m(f){ + x = f.apply(x + x); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Op.jav b/lib/resources/bytecode/javFiles/Op.jav new file mode 100644 index 0000000..082f48d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Op.jav @@ -0,0 +1,16 @@ +import java.lang.Integer; +import java.lang.String; +import java.lang.Long; +import java.lang.Float; +import java.lang.Double; +import java.lang.Boolean; +import java.lang.Short; +import java.lang.Byte; + +public class Op { + + m(a, b) { + //var c = a+b; + return a+b; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Op1.jav b/lib/resources/bytecode/javFiles/Op1.jav new file mode 100644 index 0000000..48af9df --- /dev/null +++ b/lib/resources/bytecode/javFiles/Op1.jav @@ -0,0 +1,34 @@ +import java.lang.Boolean; +import java.lang.Integer; + +public class Op1 { + public not() { + var b = false; + var c = !b; + return c; + } + + public or() { + var a = 10; + var b = 20; + return a | b; + } + + public and() { + var a = 10; + var b = 20; + return a & b; + } + + public xor() { + var a = 10; + var b = 20; + return a ^ b; + } + + public mod() { + var a = 10; + var b = 2; + return a % b; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Op2.jav b/lib/resources/bytecode/javFiles/Op2.jav new file mode 100644 index 0000000..cda23ae --- /dev/null +++ b/lib/resources/bytecode/javFiles/Op2.jav @@ -0,0 +1,17 @@ +import java.lang.Integer; +import java.lang.Double; +import java.lang.String; + +public class Op2 { + public m(){ + var x = ""; + var a = 5+x; + + Integer x = 10; + Double y = 10.5; + + var a = x - y; + + return a; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/OverlaodGen.jav b/lib/resources/bytecode/javFiles/OverlaodGen.jav new file mode 100644 index 0000000..d594649 --- /dev/null +++ b/lib/resources/bytecode/javFiles/OverlaodGen.jav @@ -0,0 +1,11 @@ +import java.util.Vector; + +class OverlaodGen { + void method(Vector v) { +// Integer i = v.get(0); + } + + void method(Vector v) { +// String s = v.get(0); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/OverloadPattern.jav b/lib/resources/bytecode/javFiles/OverloadPattern.jav new file mode 100644 index 0000000..e7f777d --- /dev/null +++ b/lib/resources/bytecode/javFiles/OverloadPattern.jav @@ -0,0 +1,50 @@ +import java.lang.Integer; +import java.lang.Number; +import java.lang.Float; + +record Point(Number x, Number y) {} + +public class OverloadPattern { + public m(Point(Integer x, Integer y)) { + return x + y; + } + + public m(Point(Float x, Float y)) { + return x * y; + } + + public m(Integer x) { + return x; + } +} + +/* +public class OverloadPattern { + Integer m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(Point point) { + var x = point.x(); + var y = point.y(); + return x + y; + } + + Float m$Point$_$java$lang$Float$_$java$lang$Float$_$(Point point) { + var x = point.x(); + var y = point.y(); + return x * y; + } + + Number m(Point point) { + return switch(point) { + case Point(Integer x, Integer y) -> + m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(point); + case Point(Float x, Float y) -> + m$Point$_$java$lang$Float$_$java$lang$Float$_$(point); + default -> throw new IllegalArgumentException(); + } + } + + Integer m(Integer x) { + return x; + } +} + +*/ \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Overloading.jav b/lib/resources/bytecode/javFiles/Overloading.jav new file mode 100644 index 0000000..c44a7a9 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Overloading.jav @@ -0,0 +1,18 @@ +import java.lang.String; + +public class Overloading{ + + public test(x){ + return x.methode(); + } + + public methode(){ + return "Overloading"; + } +} + +public class Overloading2{ + public methode(){ + return "Overloading2"; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/OverrideEquals.jav b/lib/resources/bytecode/javFiles/OverrideEquals.jav new file mode 100644 index 0000000..cabb6d4 --- /dev/null +++ b/lib/resources/bytecode/javFiles/OverrideEquals.jav @@ -0,0 +1,12 @@ +import java.lang.Object; +import java.lang.Boolean; + +public class OverrideEquals extends OverrideRoot { + public boolean equals(Object o) { + return true; + } + + public int method(int var1, float var2) { + return 0; + } +} diff --git a/lib/resources/bytecode/javFiles/OverrideRoot.java b/lib/resources/bytecode/javFiles/OverrideRoot.java new file mode 100644 index 0000000..5d09759 --- /dev/null +++ b/lib/resources/bytecode/javFiles/OverrideRoot.java @@ -0,0 +1,3 @@ +public abstract class OverrideRoot { + public abstract int method(int a, float b); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Package.jav b/lib/resources/bytecode/javFiles/Package.jav new file mode 100644 index 0000000..bbc1e51 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Package.jav @@ -0,0 +1,5 @@ +package strucType.input; + +class Neu +{ +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Pair.jav b/lib/resources/bytecode/javFiles/Pair.jav new file mode 100644 index 0000000..4547ad1 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Pair.jav @@ -0,0 +1,17 @@ +import java.util.Vector; +import java.lang.Boolean; +import java.lang.Object; + + +public class Pair { + T x; + U y; + + public fst() { + return x; + } + + public snd() { + return y; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/PairNoGenerics.jav b/lib/resources/bytecode/javFiles/PairNoGenerics.jav new file mode 100644 index 0000000..e69de29 diff --git a/lib/resources/bytecode/javFiles/Plus.jav b/lib/resources/bytecode/javFiles/Plus.jav new file mode 100644 index 0000000..74bdc61 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Plus.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; +import java.lang.String; + +public class Plus { + + public m(a,b) { + return a+b; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/PostIncDec.jav b/lib/resources/bytecode/javFiles/PostIncDec.jav new file mode 100644 index 0000000..d3672aa --- /dev/null +++ b/lib/resources/bytecode/javFiles/PostIncDec.jav @@ -0,0 +1,27 @@ +import java.lang.Integer; + +public class PostIncDec { + public m() { + var i = 0; + i++; + return i; + } + + public m2() { + var i = 0; + var j = i++; + return j; + } + + public d() { + var i = 0; + i--; + return i; + } + + public d2() { + var i = 0; + var j = i--; + return j; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/PreInc.jav b/lib/resources/bytecode/javFiles/PreInc.jav new file mode 100644 index 0000000..df66797 --- /dev/null +++ b/lib/resources/bytecode/javFiles/PreInc.jav @@ -0,0 +1,28 @@ +import java.lang.Integer; + +public class PreInc { + public m() { + var i = 0; + ++i; + return i; + } + + public m2() { + var i = 0; + var j = ++i; + return j; + } + + public d() { + var i = 0; + --i; + return i; + } + + public d2() { + var i = 0; + var j = --i; + return j; + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Put.jav b/lib/resources/bytecode/javFiles/Put.jav new file mode 100644 index 0000000..113f284 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Put.jav @@ -0,0 +1,19 @@ +import java.util.Vector; +import java.util.Stack; + +public class Put { + + public putElement(ele, v) { + v.addElement(ele); + } + + public putElement(ele, s) { + s.push(ele); + } + + + public main(ele, x) { + putElement(ele, x); + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/RecordTest.jav b/lib/resources/bytecode/javFiles/RecordTest.jav new file mode 100644 index 0000000..a19d1f0 --- /dev/null +++ b/lib/resources/bytecode/javFiles/RecordTest.jav @@ -0,0 +1,22 @@ +import java.lang.Integer; + +record Rec(Integer a, Integer b) {} + +/*public class Rec { + x; y; + Rec(Integer a, Integer b) { + x = a; + y = b; + } +}*/ + +public class RecordTest { + Rec a = new Rec(10, 20); + Rec b = new Rec(10, 20); + Rec c = new Rec(20, 40); + + public doesEqual() { return a.equals(b); } + public doesNotEqual() { return b.equals(c); } + public hashCode() { return a.hashCode(); } + public toString() { return a.toString(); } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/RecursiveMeth.jav b/lib/resources/bytecode/javFiles/RecursiveMeth.jav new file mode 100644 index 0000000..be35a43 --- /dev/null +++ b/lib/resources/bytecode/javFiles/RecursiveMeth.jav @@ -0,0 +1,5 @@ +public class RecursiveMeth{ + public Integer test(){ + return this.test(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/RelOps.jav b/lib/resources/bytecode/javFiles/RelOps.jav new file mode 100644 index 0000000..63491d9 --- /dev/null +++ b/lib/resources/bytecode/javFiles/RelOps.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; +import java.lang.Boolean; + +public class RelOps { + public m(a,b){ + return a { + + public Scalar(v) { + Integer i; + i = 0; + while(i < v.size()) { + this.add(v.elementAt(i)); + i=i+1; + } + } + + public mul(v) { + var ret = 0; + var i = 0; + while(i < size()) { + ret = ret + this.elementAt(i) * v.elementAt(i); + i = i+1; + } + return ret; + } +} diff --git a/lib/resources/bytecode/javFiles/SimpleCycle.jav b/lib/resources/bytecode/javFiles/SimpleCycle.jav new file mode 100644 index 0000000..92f505b --- /dev/null +++ b/lib/resources/bytecode/javFiles/SimpleCycle.jav @@ -0,0 +1,25 @@ +public class SimpleCycle { + + m(){ + var g; + var h; + g = h; + h = g; + /* + var y; + var z; + y=z; + z=y; + + var j = z; + var x; + b = a; + var c = b; + var f = d; + b = x; + var l = c; + a = l; + */ + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Sorting.jav b/lib/resources/bytecode/javFiles/Sorting.jav new file mode 100644 index 0000000..345819d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Sorting.jav @@ -0,0 +1,23 @@ +import java.util.List; +import java.util.ArrayList; +import java.lang.String; + +public class Sorting{ + merge(a, b){ + a.addAll(b); + return a; + } + +sort(in){ + var firstHalf = in; + var secondHalf = in; + return merge(sort(firstHalf), sort(secondHalf)); +} + + + /* + void sort(a){ + a = merge(a,a); + } + */ +} diff --git a/lib/resources/bytecode/javFiles/Static.jav b/lib/resources/bytecode/javFiles/Static.jav new file mode 100644 index 0000000..a02ef3c --- /dev/null +++ b/lib/resources/bytecode/javFiles/Static.jav @@ -0,0 +1,18 @@ +import java.lang.Integer; + +class Other { + static field = 20; +} + +public class Static { + static i = 20; + + static { + var x = 30; + i = x; + } + + public static m() { + return i + Other.field; + } +} diff --git a/lib/resources/bytecode/javFiles/StaticM.jav b/lib/resources/bytecode/javFiles/StaticM.jav new file mode 100644 index 0000000..6689003 --- /dev/null +++ b/lib/resources/bytecode/javFiles/StaticM.jav @@ -0,0 +1,10 @@ +public class StaticM { + + public static void m() { + System.out.println("Test"); + } + + public static void m2() { + m(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/SubMatrix.jav b/lib/resources/bytecode/javFiles/SubMatrix.jav new file mode 100644 index 0000000..f761321 --- /dev/null +++ b/lib/resources/bytecode/javFiles/SubMatrix.jav @@ -0,0 +1,13 @@ +import java.util.Vector; +import java.lang.Integer; + +public class Matrix2 extends Vector { + +} + +public class SubMatrix extends Matrix2 { + m(){ + Vector v = new Vector(); + v.add(1); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Subclass.jav b/lib/resources/bytecode/javFiles/Subclass.jav new file mode 100644 index 0000000..fe6e920 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Subclass.jav @@ -0,0 +1,6 @@ +public class Subclass extends Superclass { + + public void printMethod() { + super.printMethod(); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/SuperCall.jav b/lib/resources/bytecode/javFiles/SuperCall.jav new file mode 100644 index 0000000..08b8a04 --- /dev/null +++ b/lib/resources/bytecode/javFiles/SuperCall.jav @@ -0,0 +1,11 @@ +import java.lang.Integer; + +class Parent { + public Parent(Integer x) {} +} + +public class SuperCall extends Parent { + public SuperCall() { + super(20); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Superclass.jav b/lib/resources/bytecode/javFiles/Superclass.jav new file mode 100644 index 0000000..d58089d --- /dev/null +++ b/lib/resources/bytecode/javFiles/Superclass.jav @@ -0,0 +1,6 @@ +public class Superclass { + + public void printMethod() { + System.out.println("Printed in Superclass."); + } +} diff --git a/lib/resources/bytecode/javFiles/Switch.jav b/lib/resources/bytecode/javFiles/Switch.jav new file mode 100644 index 0000000..f120f81 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Switch.jav @@ -0,0 +1,17 @@ +import java.lang.Integer; +import java.lang.Object; +import java.lang.Float; + +public record Rec(Integer a, Object b) {} + +public class Switch { + public main(o) { + return switch (o) { + case Rec(Integer a, Integer b) -> a + b; + case Rec(Integer a, Float b) -> a + 10; + case Rec(Integer a, Rec(Integer b, Integer c)) -> a + b + c; + case Integer i -> i; + default -> 0; + }; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Switch2.jav b/lib/resources/bytecode/javFiles/Switch2.jav new file mode 100644 index 0000000..c75aaa5 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Switch2.jav @@ -0,0 +1,13 @@ +import java.lang.Integer; + +record Point(x, y) {} + +class Switch2 { + m() { + var pt = new Point(10, 20); + return switch (pt) { + case Point(x, y) -> 10; + default -> 20; + }; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/SwitchString.jav b/lib/resources/bytecode/javFiles/SwitchString.jav new file mode 100644 index 0000000..53dcc93 --- /dev/null +++ b/lib/resources/bytecode/javFiles/SwitchString.jav @@ -0,0 +1,14 @@ +import java.lang.Integer; +import java.lang.String; +import java.lang.Object; + +public class SwitchString { + public main(o) { + return switch (o) { + case "AaAaAa" -> 1; // These two have the same hash code! + case "AaAaBB" -> 2; + case "test", "TEST" -> 3; + default -> 4; + }; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/TXGenerics.jav b/lib/resources/bytecode/javFiles/TXGenerics.jav new file mode 100644 index 0000000..7f0f708 --- /dev/null +++ b/lib/resources/bytecode/javFiles/TXGenerics.jav @@ -0,0 +1,11 @@ +import java.lang.String; + +public class TXGenerics { + a; + b; + + public test() { + var c = new Cycle(); + c.m(a, b); + } +} diff --git a/lib/resources/bytecode/javFiles/Ternary.jav b/lib/resources/bytecode/javFiles/Ternary.jav new file mode 100644 index 0000000..321490b --- /dev/null +++ b/lib/resources/bytecode/javFiles/Ternary.jav @@ -0,0 +1,9 @@ +import java.lang.Boolean; +import java.lang.String; +import java.lang.Integer; + +public class Ternary { + public main(x) { + return x > 10 ? "big" : "small"; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Tph.jav b/lib/resources/bytecode/javFiles/Tph.jav new file mode 100644 index 0000000..22f2f94 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph.jav @@ -0,0 +1,11 @@ +public class Tph { + + public m(a,b){ + var c = m2(b); + return a; + } + + public m2(b){ + return b; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Tph2.jav b/lib/resources/bytecode/javFiles/Tph2.jav new file mode 100644 index 0000000..04ea5ba --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph2.jav @@ -0,0 +1,6 @@ +public class Tph2 { + id = x->x; + id3 (x) { + return id.apply(x); + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Tph3.jav b/lib/resources/bytecode/javFiles/Tph3.jav new file mode 100644 index 0000000..553e274 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph3.jav @@ -0,0 +1,14 @@ +public class Tph3 { +// m(a,b){ +// var c = m2(a,b); +// return c; +// } +// +// m2(a,b){ +// return m(a,b); +// } + m1(x, y) { m2(x); x = y; + } + + m2(y) { m1(y, y); } +} diff --git a/lib/resources/bytecode/javFiles/Tph4.jav b/lib/resources/bytecode/javFiles/Tph4.jav new file mode 100644 index 0000000..58fe1d1 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph4.jav @@ -0,0 +1,12 @@ +public class Tph4{ + m(a,b){ + var c = m2(b); + var d = m2(c); + return d; + } + + m2(b){ + return b; + } + +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Tph5.jav b/lib/resources/bytecode/javFiles/Tph5.jav new file mode 100644 index 0000000..e73cfa2 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph5.jav @@ -0,0 +1,13 @@ +public class Tph5 { +// m(a,b,c){ +// a = c; +// b = c; +// return a; +// } + + m(x,y){ + x = m2(y); + } + + m2(y) { return y; } +} diff --git a/lib/resources/bytecode/javFiles/Tph6.jav b/lib/resources/bytecode/javFiles/Tph6.jav new file mode 100644 index 0000000..2f9e429 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph6.jav @@ -0,0 +1,14 @@ +public class Tph6 { +// m(a,b,c){ +// a = c; +// b = c; +// return a; +// } + + m(x,y){ + var c = m2(y); + c = m2(x); + } + + m2(y) { return y; } +} diff --git a/lib/resources/bytecode/javFiles/Tph7.jav b/lib/resources/bytecode/javFiles/Tph7.jav new file mode 100644 index 0000000..cc55afb --- /dev/null +++ b/lib/resources/bytecode/javFiles/Tph7.jav @@ -0,0 +1,11 @@ +public class Tph7 { + + m(a,b){ + var c = m2(b); + return m2(b); + } + + m2(b){ + return b; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/TypeCast.jav b/lib/resources/bytecode/javFiles/TypeCast.jav new file mode 100644 index 0000000..dffab1a --- /dev/null +++ b/lib/resources/bytecode/javFiles/TypeCast.jav @@ -0,0 +1,11 @@ +import java.lang.Object; +import java.lang.Integer; +import java.util.List; +import java.util.ArrayList; + +public class TypeCast { + public void main() { + Object a = new ArrayList(); + ArrayList b = (ArrayList) a; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/TypedID.jav b/lib/resources/bytecode/javFiles/TypedID.jav new file mode 100644 index 0000000..aa88583 --- /dev/null +++ b/lib/resources/bytecode/javFiles/TypedID.jav @@ -0,0 +1,12 @@ +public class TypedID/* */ { + + lam = x-> x; + + id(b){ + return b; + } + + m(){ + return lam; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Vector.jav b/lib/resources/bytecode/javFiles/Vector.jav new file mode 100644 index 0000000..5c21cff --- /dev/null +++ b/lib/resources/bytecode/javFiles/Vector.jav @@ -0,0 +1,23 @@ +import java.util.ArrayList; +import java.util.Vector; +import java.lang.Object; + +class MyVector{ + +id(x){ + Object i; + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + x.add(i); + return x; +} +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/VectorAdd.jav b/lib/resources/bytecode/javFiles/VectorAdd.jav new file mode 100644 index 0000000..2ad73aa --- /dev/null +++ b/lib/resources/bytecode/javFiles/VectorAdd.jav @@ -0,0 +1,26 @@ +import java.util.Vector; +import java.lang.Integer; +import java.lang.String; + +public class VectorAdd { + vectorAdd(v1, v2) { + var i = 0; + v1 = new Vector(); + var erg = new Vector<>(); + while (i < v1.size()) { + erg.addElement(v1.elementAt(i) + v2.elementAt(i)); + i++; + } + return erg; + } + + m(x, y, z) { + x = new Vector(); + y = new Vector(); + x.add(1); + y.add("2"); + //Integer i = x.elementAt(0); + //String s = y.elementAt(0); + return z.addAll(x); + } +} diff --git a/lib/resources/bytecode/javFiles/VectorSuper.jav b/lib/resources/bytecode/javFiles/VectorSuper.jav new file mode 100644 index 0000000..fbadafb --- /dev/null +++ b/lib/resources/bytecode/javFiles/VectorSuper.jav @@ -0,0 +1,11 @@ +import java.util.Vector; +import java.lang.Integer; + +public class VectorSuper { + + m(x){ + Integer y = 1; + x.addElement(y); + //return x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/VoidMeth.jav b/lib/resources/bytecode/javFiles/VoidMeth.jav new file mode 100644 index 0000000..6b3ab21 --- /dev/null +++ b/lib/resources/bytecode/javFiles/VoidMeth.jav @@ -0,0 +1,4 @@ +public class VoidMeth{ + public void test(){ + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/WC.jav b/lib/resources/bytecode/javFiles/WC.jav new file mode 100644 index 0000000..389a4fc --- /dev/null +++ b/lib/resources/bytecode/javFiles/WC.jav @@ -0,0 +1,8 @@ +import java.lang.Integer; +import java.util.List; +public class WC { + + void m (List a, List b) { + + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/While.jav b/lib/resources/bytecode/javFiles/While.jav new file mode 100644 index 0000000..df259cf --- /dev/null +++ b/lib/resources/bytecode/javFiles/While.jav @@ -0,0 +1,12 @@ +import java.lang.Integer; +import java.lang.Long; +import java.lang.Double; + +public class While { + public m(x) { + while(x < 2) { + x = x+1; + } + return x; + } +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/Wildcards.jav b/lib/resources/bytecode/javFiles/Wildcards.jav new file mode 100644 index 0000000..7dca051 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Wildcards.jav @@ -0,0 +1,8 @@ +import java.util.List; +import java.lang.Number; + +public class Wildcards { + public void m1(List a) {} + public void m2(List a) {} + public void m3(List a) {} +} diff --git a/lib/resources/bytecode/javFiles/Y.jav b/lib/resources/bytecode/javFiles/Y.jav new file mode 100644 index 0000000..0c14b49 --- /dev/null +++ b/lib/resources/bytecode/javFiles/Y.jav @@ -0,0 +1,42 @@ +import java.lang.Integer; + +public class Y { + y; + //factorial; + + public Y() { + y = f -> t -> f.apply(y.apply(f)).apply(t); + //factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); }); + } + /* + getY() { + return y; + } + */ +} +/* +class fac1 { + factorial; + + fac1() { + var y; + y = new Y().getY(); + factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); }); + } +} + +ergibt Parse-Error +class fac1 { + factorial; + + fac1() { + var y; + y = new Y<>().y; + factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); }); + } + public static void main(String args[]) { + System.out.println(new fac1().factorial.apply(3)); + } + +} +*/ \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/applyLambda.jav b/lib/resources/bytecode/javFiles/applyLambda.jav new file mode 100644 index 0000000..37a3fba --- /dev/null +++ b/lib/resources/bytecode/javFiles/applyLambda.jav @@ -0,0 +1,16 @@ +import java.util.Vector; +class Apply { } + +public class applyLambda { + + public m () { + var lam1 = (x) -> { + return x; + }; + + return lam1.apply(new Apply()); + //return lam1; + //return new Vector(); + } +} + diff --git a/lib/resources/bytecode/javFiles/fc.jav b/lib/resources/bytecode/javFiles/fc.jav new file mode 100644 index 0000000..b387cb9 --- /dev/null +++ b/lib/resources/bytecode/javFiles/fc.jav @@ -0,0 +1,18 @@ +import java.util.List; + +class Test{ + methode(param1, param2, param3) { + param2.add(param3); + return param1.meth(param2); + } +} + +interface Klasse1{ + Klasse1 meth(p); + Klasse1 meth(Klasse2 p); +} + +interface Klasse2{ + Klasse1 meth(Klasse1 p); + Klasse2 meth(Klasse2 p); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/mathStruc.jav b/lib/resources/bytecode/javFiles/mathStruc.jav new file mode 100644 index 0000000..171881b --- /dev/null +++ b/lib/resources/bytecode/javFiles/mathStruc.jav @@ -0,0 +1,15 @@ +import java.util.Vector; +import java.lang.Integer; + +public class mathStruc { + model; + + //Fun1*, Fun1*,MathStruc >> + innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(model,ms.model)); + + public mathStruc(m) { + model =m; + //innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(this.model,ms.model)); + } +} + diff --git a/lib/resources/bytecode/javFiles/mathStrucInteger.jav b/lib/resources/bytecode/javFiles/mathStrucInteger.jav new file mode 100644 index 0000000..f1f6755 --- /dev/null +++ b/lib/resources/bytecode/javFiles/mathStrucInteger.jav @@ -0,0 +1,23 @@ +import java.util.Vector; +import java.lang.Integer; + +public class mathStrucInteger { + model; + + innerOp = (o) -> (ms) -> new mathStrucInteger<>(o.apply(model,ms.model)); + + public mathStrucInteger(m) { + model =m; + } +} + +class mathStrucIntegerUse { + + main() { + var ms; + ms = new mathStrucInteger<>(2); + var ms2; + ms2 = ms.innerOp.apply((x,y) -> x+y).apply(ms); + return ms2; + } +} diff --git a/lib/resources/bytecode/javFiles/mathStrucMatrixOP.jav b/lib/resources/bytecode/javFiles/mathStrucMatrixOP.jav new file mode 100644 index 0000000..2b24f03 --- /dev/null +++ b/lib/resources/bytecode/javFiles/mathStrucMatrixOP.jav @@ -0,0 +1,91 @@ +//PL 2019-10-24: laeuft nicht durch, zu gross +import java.util.Vector; +import java.lang.Integer; +import java.lang.Boolean; + +public class mathStrucMatrixOP { + model; + + innerOp = (o) -> (ms) -> new mathStrucMatrixOP<>(o.apply(model,ms.model)); + + public mathStrucMatrixOP(m) { + model =m; + } +} + +public class MatrixOP extends Vector> { + + MatrixOP () { + } + + MatrixOP(vv) { + Integer i; + i = 0; + while(i < vv.size()) { +// Boolean a = this.add(vv.elementAt(i)); + this.add(vv.elementAt(i)); + i=i+1; + } + } + + public mul = (m1, m2) -> { + var ret = new MatrixOP(); + var i = 0; + while(i < m1.size()) { + var v1 = m1.elementAt(i); + var v2 = new Vector(); + var j = 0; + while(j < v1.size()) { + var erg = 0; + var k = 0; + while(k < v1.size()) { + erg = erg + v1.elementAt(k) + * m2.elementAt(k).elementAt(j); + k++; } +// v2.addElement(new Integer(erg)); + v2.addElement(erg); + j++; } + ret.addElement(v2); + i++; + } + return ret; + }; +} + + +class mathStrucUseMatrixOP { + + main() { + Vector> vv = new Vector>(); + Vector v1 = new Vector(); + v1.addElement(2); + v1.addElement(2); + Vector v2 = new Vector(); + v2.addElement(3); + v2.addElement(3); + vv.addElement(v1); + vv.addElement(v2); + + MatrixOP m1 = new MatrixOP(vv); + + Vector> vv1 = new Vector>(); + Vector v3 = new Vector(); + v3.addElement(2); + v3.addElement(2); + Vector v4 = new Vector(); + v4.addElement(3); + v4.addElement(3); + vv1.addElement(v3); + vv1.addElement(v4); + + MatrixOP m2 = new MatrixOP(vv1); + + var mms; + mms = new mathStrucMatrixOP<>(m1); + var mms2; + mms2 = new mathStrucMatrixOP<>(m2); + var mms3; + mms3 = mms.innerOp.apply(m1.mul).apply(mms2); + return mms3; + } +} diff --git a/lib/resources/bytecode/javFiles/test.jav b/lib/resources/bytecode/javFiles/test.jav new file mode 100644 index 0000000..303d167 --- /dev/null +++ b/lib/resources/bytecode/javFiles/test.jav @@ -0,0 +1,15 @@ +class Test{ + methode(param1, param2, param3) { + return param1.meth(param2.meth(param3)); + } +} + +interface Klasse1{ + Klasse1 meth(Klasse1 p); + Klasse1 meth(Klasse2 p); +} + +interface Klasse2{ + Klasse1 meth(Klasse1 p); + Klasse2 meth(Klasse2 p); +} \ No newline at end of file diff --git a/lib/resources/bytecode/javFiles/test1.jav b/lib/resources/bytecode/javFiles/test1.jav new file mode 100644 index 0000000..4b34948 --- /dev/null +++ b/lib/resources/bytecode/javFiles/test1.jav @@ -0,0 +1,7 @@ +class Faculty { + + int a; + m (int x) { + return a+x; + } +} diff --git a/lib/resources/insertGenerics/javFiles/TestAny.jav b/lib/resources/insertGenerics/javFiles/TestAny.jav new file mode 100644 index 0000000..86c0ceb --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestAny.jav @@ -0,0 +1,13 @@ +class TestAny { + a; + b = a; + anyMethod() { + var f; + return f; + } + otherMethod(e) { + b = e; + e = a; + return e; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestAssign.jav b/lib/resources/insertGenerics/javFiles/TestAssign.jav new file mode 100644 index 0000000..d401641 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestAssign.jav @@ -0,0 +1,9 @@ +class TestAssign { + assign(x, y) { + x = y; + } + + assign2(x, y) { + assign(x, y); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestClassField.jav b/lib/resources/insertGenerics/javFiles/TestClassField.jav new file mode 100644 index 0000000..f3d24e5 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestClassField.jav @@ -0,0 +1,6 @@ +class Example{ + f; + fReturn(){ + return f; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestContraVariant.jav b/lib/resources/insertGenerics/javFiles/TestContraVariant.jav new file mode 100644 index 0000000..9c060f0 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestContraVariant.jav @@ -0,0 +1,38 @@ +public class TestContraVariant { + main(x, y) { + var y2 = m(x, y); + var y3 = y2.snd(); + var z; + y3 = z; + return new Pair<>(x, z); + } + + m(x, y) { + var x2 = main(x, y); + var x3 = x2.fst(); + var z; + x3 = z; + return new Pair<>(z, y); + } +} + +class Pair { + public T x; + public U y; + + public Pair() { + } + + public Pair(T var1, U var2) { + x = var1; + y = var2; + } + + public T fst() { + return x; + } + + public U snd() { + return y; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestGGFinder.jav b/lib/resources/insertGenerics/javFiles/TestGGFinder.jav new file mode 100644 index 0000000..cc94cad --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestGGFinder.jav @@ -0,0 +1,17 @@ +public class TestGGFinder { + a; + + id(b) { + var c = b; + return c; + } + + setA(x) { + a = x; + return a; + } + + m(x,y) { + x = id(y); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestLocalVarLambda.jav b/lib/resources/insertGenerics/javFiles/TestLocalVarLambda.jav new file mode 100644 index 0000000..ab4455c --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestLocalVarLambda.jav @@ -0,0 +1,7 @@ +public class TestLocalVarLambda { + +m(x) { + var id = z -> z; + return id.apply(x); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestMutualRecursion.jav b/lib/resources/insertGenerics/javFiles/TestMutualRecursion.jav new file mode 100644 index 0000000..60ce72c --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestMutualRecursion.jav @@ -0,0 +1,17 @@ +public class TestMutualRecursion { + a; + + id(b) { + var c = b; + return main(b,c); + } + + m(x,y) { + x = id(y); + return x; + } + + main(x,y) { + return m(id(x),y); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField.jav b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField.jav new file mode 100644 index 0000000..82dc42d --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField.jav @@ -0,0 +1,22 @@ +public class TestMutualRecursionWithField { + a; + + id(b) { + var c = b; + return main(b,c); + } + + setA(x) { + a = x; + return a; + } + + m(x,y) { + x = id(y); + return x; + } + + main(x,y) { + return m(id(x),setA(y)); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField2.jav b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField2.jav new file mode 100644 index 0000000..727e603 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField2.jav @@ -0,0 +1,22 @@ +public class TestMutualRecursionWithField2 { + a; + + id(b) { + var c = b; + return main(b,c); + } + + setA(x) { + a = x; + return a; + } + + m(x,y) { + x = id(y); + return x; + } + + main(x,y) { + return m(setA(x),id(y)); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField3.jav b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField3.jav new file mode 100644 index 0000000..24e0989 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestMutualRecursionWithField3.jav @@ -0,0 +1,23 @@ +public class TestMutualRecursionWithField3 { + a; + + id(b) { + var c = b; + return main(b,c); + } + + setA(x) { + a = x; + return a; + } + + m(x,y) { + x = id(y); + return x; + } + + main(x,y) { + var z = m(setA(x),id(y)); + return z; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestReturnVar.jav b/lib/resources/insertGenerics/javFiles/TestReturnVar.jav new file mode 100644 index 0000000..0688e5b --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestReturnVar.jav @@ -0,0 +1,6 @@ +class VarReturn { + anyMethod() { + var f; + return f; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestSecondLineOfClassConstraints.jav b/lib/resources/insertGenerics/javFiles/TestSecondLineOfClassConstraints.jav new file mode 100644 index 0000000..16275a5 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestSecondLineOfClassConstraints.jav @@ -0,0 +1,12 @@ +class Example { + a; + b = a; + anyMethod() { + var f; + return f; + } + otherMethod(e) { + e = a; + return e; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics.jav b/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics.jav new file mode 100644 index 0000000..33a79e5 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics.jav @@ -0,0 +1,13 @@ +class TPHsAndGenerics { + id = x -> x; + id2 (x) { + return id.apply(x); + } + m(a, b){ + var c = m2(a,b); + return a; + } + m2(a, b){ + return b; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics2.jav b/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics2.jav new file mode 100644 index 0000000..2a75e82 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestTPHsAndGenerics2.jav @@ -0,0 +1,14 @@ +class TPHsAndGenerics2 { + id = x -> x; + id2 (x) { + return id.apply(x); + } + m(a, b){ + var c = m2(a,b); + return a; + } + m2(a, b){ + return b; + } + +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestThreeArgs.jav b/lib/resources/insertGenerics/javFiles/TestThreeArgs.jav new file mode 100644 index 0000000..fe22dd3 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestThreeArgs.jav @@ -0,0 +1,15 @@ +public class TestThreeArgs { + a; + + id(b) { + var a /* = null */; + var c = b; + m(a,a,b); + return c; + } + + m(x,y, z) { + x = id(y); + return x; + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestTwoArgs.jav b/lib/resources/insertGenerics/javFiles/TestTwoArgs.jav new file mode 100644 index 0000000..b4754fe --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestTwoArgs.jav @@ -0,0 +1,29 @@ +public class TestTwoArgs // +{ + //AS + a; + + //AN -> AN + id(b) { + var c = b; + return c; + } + + //T -> AS + setA(x) { + a = x; + return a; + } + + //(AG,Z) -> AG + m(x,y) { + x = id(y); + return x; + } + + // (AI, AH) -> AG + main(x,y) { + return m(id(x),setA(y)); + } +} + diff --git a/lib/resources/insertGenerics/javFiles/TestTwoArgs2.jav b/lib/resources/insertGenerics/javFiles/TestTwoArgs2.jav new file mode 100644 index 0000000..f8c270a --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestTwoArgs2.jav @@ -0,0 +1,17 @@ +public class TestTwoArgs2 { + a; + + id(b) { + var c = b; + return c; + } + + m(x,y) { + x = id(y); + return x; + } + + main(x,y) { + return m(id(x),m(x,y)); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestTwoCalls.jav b/lib/resources/insertGenerics/javFiles/TestTwoCalls.jav new file mode 100644 index 0000000..e3f0cfc --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestTwoCalls.jav @@ -0,0 +1,14 @@ +public class TestTwoCalls { + + // O -> O + id(b) { + var c = b; + return c; + } + + // (S, T) -> T + main(x,y) { + id(x); + return id(y); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestVector.jav b/lib/resources/insertGenerics/javFiles/TestVector.jav new file mode 100644 index 0000000..5f29c83 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestVector.jav @@ -0,0 +1,12 @@ +import java.util.Vector; + +public class TestVector { + + m(v, w) { + w.addElement(id(v.elementAt(0))); + } + + id(x) { + return x; + } +} diff --git a/lib/resources/insertGenerics/javFiles/TestVectorArg.jav b/lib/resources/insertGenerics/javFiles/TestVectorArg.jav new file mode 100644 index 0000000..ca29f82 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestVectorArg.jav @@ -0,0 +1,12 @@ +import java.util.Vector; + +public class TestVectorArg { + + add(v, e) { + v.addElement(e); + } + + main(v, e) { + add(v, e); + } +} \ No newline at end of file diff --git a/lib/resources/insertGenerics/javFiles/TestVoidMeth.jav b/lib/resources/insertGenerics/javFiles/TestVoidMeth.jav new file mode 100644 index 0000000..50ee720 --- /dev/null +++ b/lib/resources/insertGenerics/javFiles/TestVoidMeth.jav @@ -0,0 +1,4 @@ +class VoidMeth { + anyMethod() { + } +} \ No newline at end of file diff --git a/lib/resources/packageTest/pkg/sub/Cycle1.jav b/lib/resources/packageTest/pkg/sub/Cycle1.jav new file mode 100644 index 0000000..79267a0 --- /dev/null +++ b/lib/resources/packageTest/pkg/sub/Cycle1.jav @@ -0,0 +1,11 @@ +package pkg.sub; + +import java.lang.Integer; +import pkg.sub2.Cycle2; + +public class Cycle1 { + test() { + var cycle2 = new Cycle2(); + cycle2.test(); + } +} \ No newline at end of file diff --git a/lib/resources/packageTest/pkg/sub/Interface.jav b/lib/resources/packageTest/pkg/sub/Interface.jav new file mode 100644 index 0000000..388b424 --- /dev/null +++ b/lib/resources/packageTest/pkg/sub/Interface.jav @@ -0,0 +1,3 @@ +package pkg.sub; + +public interface Interface {} diff --git a/lib/resources/packageTest/pkg/sub/Test1.jav b/lib/resources/packageTest/pkg/sub/Test1.jav new file mode 100644 index 0000000..7acebfb --- /dev/null +++ b/lib/resources/packageTest/pkg/sub/Test1.jav @@ -0,0 +1,11 @@ +package pkg.sub; + +import pkg.sub2.Test2; + +public class Test1 { + + main() { + var t2 = new Test2(); + t2.test(); + } +} \ No newline at end of file diff --git a/lib/resources/packageTest/pkg/sub2/Cycle2.jav b/lib/resources/packageTest/pkg/sub2/Cycle2.jav new file mode 100644 index 0000000..8a13e10 --- /dev/null +++ b/lib/resources/packageTest/pkg/sub2/Cycle2.jav @@ -0,0 +1,11 @@ +package pkg.sub2; + +import java.lang.Integer; +import pkg.sub.Cycle1; + +public class Cycle2 { + test() { + var cycle1 = new Cycle1(); + cycle1.test(); + } +} \ No newline at end of file diff --git a/lib/resources/packageTest/pkg/sub2/Test2.jav b/lib/resources/packageTest/pkg/sub2/Test2.jav new file mode 100644 index 0000000..a7f8927 --- /dev/null +++ b/lib/resources/packageTest/pkg/sub2/Test2.jav @@ -0,0 +1,6 @@ +package pkg.sub2; + +public class Test2 { + + test() {} +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/BinaryInMeth.ast b/lib/resources/syntaxtreegenerator/BinaryInMeth.ast new file mode 100644 index 0000000..5bb1379 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/BinaryInMeth.ast @@ -0,0 +1,22 @@ +class BinaryInMeth { + +BinaryInMeth(){ + super(()); + } + TPH CMNB m(TPH CMNC a){ + return ++a; + } + + TPH CMNF m2(TPH CMNG a, TPH CMNH b){ + return this.m Signature: [TPH CMNK, TPH CMNL](a op b); + } + + TPH CMNP m3(TPH CMNQ a){ + return this.m Signature: [TPH CMNT, TPH CMNU](++a); + } + + BinaryInMeth(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Box.ast b/lib/resources/syntaxtreegenerator/Box.ast new file mode 100644 index 0000000..1bc437b --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Box.ast @@ -0,0 +1,25 @@ +class B { + +B(){ + super(()); + } + B(){ + super(()); + } + +}class Box_Main { + +Box_Main(){ + super(()); + } + TPH T m(TPH U b){ + b.m Signature: [TPH W, TPH X](new Box_Main()); + b.m Signature: [TPH AB, TPH AC](new B()); + return; + } + + Box_Main(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/ClassGenLam.ast b/lib/resources/syntaxtreegenerator/ClassGenLam.ast new file mode 100644 index 0000000..30b4345 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/ClassGenLam.ast @@ -0,0 +1,14 @@ +class ClassGenLam { + + TPH HWDB lam; +ClassGenLam(){ + super(()); + this.lam = (TPH HWDC x) -> { + return x; + }; + } + ClassGenLam(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Cycle.ast b/lib/resources/syntaxtreegenerator/Cycle.ast new file mode 100644 index 0000000..18b435a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Cycle.ast @@ -0,0 +1,16 @@ +class Cycle { + +Cycle(){ + super(()); + } + TPH GGXG m(TPH GGXH x, TPH GGXI y){ + y = x; + x = y; + return; + } + + Cycle(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Fac.ast b/lib/resources/syntaxtreegenerator/Fac.ast new file mode 100644 index 0000000..b15ecdd --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Fac.ast @@ -0,0 +1,22 @@ +class Fac { + +Fac(){ + super(()); + } + TPH BSTE getFac(TPH BSTF n){ + TPH BSTG res; + res = 1; + TPH BSTI i; + i = 1; + while(i op n){ + res = res op i; + i++; + }; + return res; + } + + Fac(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Faculty.ast b/lib/resources/syntaxtreegenerator/Faculty.ast new file mode 100644 index 0000000..66c777a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Faculty.ast @@ -0,0 +1,25 @@ +class Faculty { + + TPH DDAL fact; +Faculty(){ + super(()); + } + TPH DDBK getFact(java.lang.Integer x){ + return this.fact.apply Signature: [TPH DDBM, TPH DDBN](x); + } + + Faculty(){ + super(()); + this.fact = (TPH DDAO x) -> { + if(x op 1) + { + return 1; + } + else + { + return x op this.fact.apply Signature: [TPH DDAW, TPH DDAX](x op 1); + }; + }; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Field.ast b/lib/resources/syntaxtreegenerator/Field.ast new file mode 100644 index 0000000..43ffa1a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Field.ast @@ -0,0 +1,16 @@ +class Field { + + TPH JBCG x; +Field(){ + super(()); + this.x = 5; + } + TPH JBCJ m(){ + return this.x; + } + + Field(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/FieldTph2.ast b/lib/resources/syntaxtreegenerator/FieldTph2.ast new file mode 100644 index 0000000..23c7c16 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/FieldTph2.ast @@ -0,0 +1,21 @@ +class FieldTph2 { + + TPH DJBG a; +FieldTph2(){ + super(()); + } + TPH DJBH m(TPH DJBI b){ + b = this.a; + return b; + } + + TPH DJBL m2(TPH DJBM c){ + this.a = c; + return; + } + + FieldTph2(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/FieldTphConsMeth.ast b/lib/resources/syntaxtreegenerator/FieldTphConsMeth.ast new file mode 100644 index 0000000..9ada601 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/FieldTphConsMeth.ast @@ -0,0 +1,27 @@ +class FieldTphConsMeth { + + TPH AINS a; +FieldTphConsMeth(){ + super(()); + } + TPH AIOE id(TPH AIOF b){ + return b; + } + + TPH AIOH setA(TPH AIOI x){ + this.a = x; + return this.a; + } + + TPH AIOM m(TPH AION x, TPH AIOO y){ + x = this.id Signature: [TPH AIOQ, TPH AIOR](y); + return; + } + + FieldTphConsMeth(TPH AINU c){ + super(()); + this.a = this.id Signature: [TPH AINX, TPH AINY](c); + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/FieldTphMMeth.ast b/lib/resources/syntaxtreegenerator/FieldTphMMeth.ast new file mode 100644 index 0000000..3a0cacd --- /dev/null +++ b/lib/resources/syntaxtreegenerator/FieldTphMMeth.ast @@ -0,0 +1,33 @@ +class FieldTphMMeth { + + TPH HBWQ a; +FieldTphMMeth(){ + super(()); + } + TPH HBXG m(TPH HBXH b, TPH HBXI d, TPH HBXJ e){ + if(e) + { + return this.m3 Signature: [TPH HBXL, TPH HBXM](b); + } + else + { + return this.m3 Signature: [TPH HBXR, TPH HBXS](d); + }; + } + + TPH HBXY m2(TPH HBXZ b){ + this.a = this.m3 Signature: [TPH HBYC, TPH HBYD](b); + return; + } + + TPH HBYH m3(TPH HBYI b){ + return b; + } + + FieldTphMMeth(TPH HBWS c, TPH HBWT d, TPH HBWU e){ + super(()); + this.a = this.m Signature: [TPH HBWX, TPH HBWY, TPH HBWZ, TPH HBXA](c, d, e); + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Gen.ast b/lib/resources/syntaxtreegenerator/Gen.ast new file mode 100644 index 0000000..20f5484 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Gen.ast @@ -0,0 +1,14 @@ +class Gen { + +Gen(){ + super(()); + } + java.util.Vector m(java.util.Vector v){ + return v; + } + + Gen(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Id.ast b/lib/resources/syntaxtreegenerator/Id.ast new file mode 100644 index 0000000..4b375d2 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Id.ast @@ -0,0 +1,18 @@ +class Id { + + TPH BDGF id2; +Id(){ + super(()); + this.id2 = (TPH BDGG x) -> { + return x; + }; + } + TPH BDGM id3(TPH BDGN x){ + return this.id2.apply Signature: [TPH BDGP, TPH BDGQ](x); + } + + Id(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Inf.ast b/lib/resources/syntaxtreegenerator/Inf.ast new file mode 100644 index 0000000..5425c25 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Inf.ast @@ -0,0 +1,28 @@ +class Inf { + +Inf(){ + super(()); + } + TPH KYAM m(TPH KYAN x, TPH KYAO y, TPH KYAP a){ + TPH KYAQ z; + TPH KYAR v; + TPH KYAS w; + TPH KYAT b; + y = x; + z = x; + v = y; + w = y; + y = a; + b = a; + TPH KYAU c; + TPH KYAV d; + c = v; + d = v; + return; + } + + Inf(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Instanceof.ast b/lib/resources/syntaxtreegenerator/Instanceof.ast new file mode 100644 index 0000000..29d0754 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Instanceof.ast @@ -0,0 +1,44 @@ +class Instanceof { + +Instanceof(){ + super(()); + } + void checkInstanceof(){ + TPH a; + a = 4; + return a instanceof java.lang.Integer; + } + + void checkInstanceOfWithPattern(){ + TPH b; + b = 4.0; + if(b instanceof d) + { + return d; + } + else + { + return Kein Double; + }; + } + + void checkInstanceOfWithGuardedPattern(){ + TPH obj; + obj = test; + TPH flag; + if(obj instanceof s op s.length Signature: [TPH]() op 5) + { + flag = s.contains Signature: [TPH, TPH](jdk); + }; + return; + } + + java.lang.Boolean equals(java.lang.Object o){ + return o instanceof other op x op other.x op y op other.y; + } + + Instanceof(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/KompTph.ast b/lib/resources/syntaxtreegenerator/KompTph.ast new file mode 100644 index 0000000..0cde632 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/KompTph.ast @@ -0,0 +1,26 @@ +class KompTph { + +KompTph(){ + super(()); + } + TPH EOGX m(TPH EOGY a, TPH EOGZ b, TPH EOHA c){ + TPH EOHB d; + d = a; + TPH EOHC e; + e = a; + a = b; + c = b; + this.m2 Signature: [TPH EOHE, TPH EOHF, TPH EOHG](a, c); + return; + } + + TPH EOHK m2(TPH EOHL a, TPH EOHM b){ + this.m Signature: [TPH EOHO, TPH EOHP, TPH EOHQ, TPH EOHR](a, a, b); + return; + } + + KompTph(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Lambda.ast b/lib/resources/syntaxtreegenerator/Lambda.ast new file mode 100644 index 0000000..1cdc8f1 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Lambda.ast @@ -0,0 +1,18 @@ +class Lambda { + +Lambda(){ + super(()); + } + TPH KIZQ m(){ + TPH KIZR lam1; + lam1 = (TPH KIZS x) -> { + return x; + }; + return lam1; + } + + Lambda(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/LambdaCapture.ast b/lib/resources/syntaxtreegenerator/LambdaCapture.ast new file mode 100644 index 0000000..de4944b --- /dev/null +++ b/lib/resources/syntaxtreegenerator/LambdaCapture.ast @@ -0,0 +1,18 @@ +class LambdaCapture { + + java.lang.Integer i; + TPH BIMD f; +LambdaCapture(){ + super(()); + this.i = 8; + } + LambdaCapture(){ + super(()); + java.lang.Integer w; + w = 7; + this.f = (TPH BIMH j) -> { + return w op this.i; + }; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Matrix.ast b/lib/resources/syntaxtreegenerator/Matrix.ast new file mode 100644 index 0000000..f4779af --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Matrix.ast @@ -0,0 +1,52 @@ +class Matrix { + +Matrix(){ + super(()); + } + TPH SBB mul(TPH SBC m){ + TPH SBD ret; + ret = new Matrix(); + TPH SBF i; + i = 0; + while(i op this.size Signature: [TPH SBJ]()){ + TPH SBM v1; + v1 = this.elementAt Signature: [TPH SBO, TPH SBP](i); + TPH SBS v2; + v2 = new java.util.Vector(); + TPH SBU j; + j = 0; + while(j op v1.size Signature: [TPH SBX]()){ + TPH SCA erg; + erg = 0; + TPH SCC k; + k = 0; + while(k op v1.size Signature: [TPH SCF]()){ + erg = erg op v1.elementAt Signature: [TPH SCI, TPH SCJ](k) op m.elementAt Signature: [TPH SCM, TPH SCN](k).elementAt Signature: [TPH SCQ, TPH SCR](j); + k++; + }; + v2.addElement Signature: [TPH SCZ, TPH SDA](erg); + j++; + }; + ret.addElement Signature: [TPH SDG, TPH SDH](v2); + i++; + }; + return ret; + } + + Matrix(){ + super(()); + return; + } + + Matrix(TPH SAF vv){ + super(()); + java.lang.Integer i; + i = 0; + while(i op vv.size Signature: [TPH SAI]()){ + this.add Signature: [TPH SAQ, TPH SAR](vv.elementAt Signature: [TPH SAM, TPH SAN](i)); + i = i op 1; + }; + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/MatrixOP.ast b/lib/resources/syntaxtreegenerator/MatrixOP.ast new file mode 100644 index 0000000..4ea4d5e --- /dev/null +++ b/lib/resources/syntaxtreegenerator/MatrixOP.ast @@ -0,0 +1,52 @@ +class MatrixOP { + + TPH JGDT mul; +MatrixOP(){ + super(()); + this.mul = (TPH JGDU m1, TPH JGDV m2) -> { + TPH JGDW ret; + ret = new MatrixOP(); + TPH JGDY i; + i = 0; + while(i op m1.size Signature: [TPH JGEB]()){ + TPH JGEE v1; + v1 = m1.elementAt Signature: [TPH JGEF, TPH JGEG](i); + TPH JGEJ v2; + v2 = new java.util.Vector(); + TPH JGEL j; + j = 0; + while(j op v1.size Signature: [TPH JGEO]()){ + TPH JGER erg; + erg = 0; + TPH JGET k; + k = 0; + while(k op v1.size Signature: [TPH JGEW]()){ + erg = erg op v1.elementAt Signature: [TPH JGEZ, TPH JGFA](k) op m2.elementAt Signature: [TPH JGFD, TPH JGFE](k).elementAt Signature: [TPH JGFH, TPH JGFI](j); + k++; + }; + v2.addElement Signature: [TPH JGFQ, TPH JGFR](erg); + j++; + }; + ret.addElement Signature: [TPH JGFX, TPH JGFY](v2); + i++; + }; + return ret; + }; + } + MatrixOP(){ + super(()); + return; + } + + MatrixOP(TPH JGGP vv){ + super(()); + java.lang.Integer i; + i = 0; + while(i op vv.size Signature: [TPH JGGS]()){ + this.add Signature: [TPH JGHA, TPH JGHB](vv.elementAt Signature: [TPH JGGW, TPH JGGX](i)); + i = i op 1; + }; + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Merge.ast b/lib/resources/syntaxtreegenerator/Merge.ast new file mode 100644 index 0000000..c3632d1 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Merge.ast @@ -0,0 +1,23 @@ +class Merge { + +Merge(){ + super(()); + } + TPH JQYM merge(TPH JQYN a, TPH JQYO b){ + a.addAll Signature: [TPH JQYP, TPH JQYQ](b); + return a; + } + + TPH JQYU sort(TPH JQYV in){ + TPH JQYW firstHalf; + firstHalf = in.subList Signature: [TPH JQYZ, TPH JQZA, TPH JQZB](1, 2); + TPH JQZE secondHalf; + secondHalf = in.subList Signature: [TPH JQZH, TPH JQZI, TPH JQZJ](1, 2); + return this.merge Signature: [TPH JQZX, TPH JQZY, TPH JQZZ](this.sort Signature: [TPH JQZO, TPH JQZP](firstHalf), this.sort Signature: [TPH JQZT, TPH JQZU](secondHalf)); + } + + Merge(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/OL.ast b/lib/resources/syntaxtreegenerator/OL.ast new file mode 100644 index 0000000..96ea150 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/OL.ast @@ -0,0 +1,41 @@ +class OL { + +OL(){ + super(()); + } + java.lang.Double m(java.lang.Double x){ + return x op x; + } + + java.lang.Integer m(java.lang.Integer x){ + return x op x; + } + + java.lang.String m(java.lang.String x){ + return x op x; + } + + java.lang.Boolean m(java.lang.Boolean x){ + return x; + } + + OL(){ + super(()); + } + +}class OLMain { + +OLMain(){ + super(()); + } + TPH BYOF main(TPH BYOG x){ + TPH BYOH ol; + ol = new OL(); + return ol.m Signature: [TPH BYOJ, TPH BYOK](x); + } + + OLMain(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/OLFun.ast b/lib/resources/syntaxtreegenerator/OLFun.ast new file mode 100644 index 0000000..4f5e08f --- /dev/null +++ b/lib/resources/syntaxtreegenerator/OLFun.ast @@ -0,0 +1,22 @@ +class OLFun { + +OLFun(){ + super(()); + } + TPH JXJR m(TPH JXJS f, TPH JXJT x){ + x = f.apply Signature: [TPH JXJV, TPH JXJW](x op x); + return x; + } + + TPH JXKA m2(TPH JXKB y){ + this.m Signature: [TPH JXKK, TPH JXKL, TPH JXKM]((TPH JXKD x) -> { + return x op 2; + }, y); + return; + } + + OLFun(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/OLFun2.ast b/lib/resources/syntaxtreegenerator/OLFun2.ast new file mode 100644 index 0000000..57415e3 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/OLFun2.ast @@ -0,0 +1,16 @@ +class OLFun2 { + + TPH CTXA x; +OLFun2(){ + super(()); + } + TPH CTXB m(TPH CTXC f){ + this.x = f.apply Signature: [TPH CTXH, TPH CTXI](this.x op this.x); + return; + } + + OLFun2(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Overloading.ast b/lib/resources/syntaxtreegenerator/Overloading.ast new file mode 100644 index 0000000..29fd0bb --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Overloading.ast @@ -0,0 +1,31 @@ +class Overloading { + +Overloading(){ + super(()); + } + TPH N test(TPH O x){ + return x.methode Signature: [TPH P](); + } + + TPH T methode(){ + return Overloading; + } + + Overloading(){ + super(()); + } + +}class Overloading2 { + +Overloading2(){ + super(()); + } + TPH AO methode(){ + return Overloading2; + } + + Overloading2(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Pair.ast b/lib/resources/syntaxtreegenerator/Pair.ast new file mode 100644 index 0000000..67a0183 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Pair.ast @@ -0,0 +1,20 @@ +class Pair { + + U a; + T b; +Pair(){ + super(()); + } + TPH IURS make(TPH IURT x){ + TPH IURU ret; + ret = new Pair(); + ret.a = x.elementAt Signature: [TPH IUSA, TPH IUSB](0); + ret.b = x.elementAt Signature: [TPH IUSG, TPH IUSH](1); + return ret; + } + + Pair(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/PatternMatching.ast b/lib/resources/syntaxtreegenerator/PatternMatching.ast new file mode 100644 index 0000000..41a2453 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/PatternMatching.ast @@ -0,0 +1,120 @@ +class Point { + + java.lang.Integer x; + java.lang.Integer y; +Point(java.lang.Integer x, java.lang.Integer y){ + super(()); + this.x = x; + this.y = y; + } + java.lang.Integer x(){ + return this.x; + } + + java.lang.Integer y(){ + return this.y; + } + + Point(java.lang.Integer x, java.lang.Integer y){ + super(()); + this.x = x; + this.y = y; + } + +}class Shape { + +}class ColoredPoint { + + Point pt; + java.lang.String color; +ColoredPoint(Point pt, java.lang.String color){ + super(()); + this.pt = pt; + this.color = color; + } + Point pt(){ + return this.pt; + } + + java.lang.String color(){ + return this.color; + } + + ColoredPoint(Point pt, java.lang.String color){ + super(()); + this.pt = pt; + this.color = color; + } + +}class Rectangle { + + ColoredPoint upperLeft; + ColoredPoint lowerRight; +Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight){ + super(()); + this.upperLeft = upperLeft; + this.lowerRight = lowerRight; + } + ColoredPoint upperLeft(){ + return this.upperLeft; + } + + ColoredPoint lowerRight(){ + return this.lowerRight; + } + + Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight){ + super(()); + this.upperLeft = upperLeft; + this.lowerRight = lowerRight; + } + +}class Color { + +Color(){ + super(()); + } + Color(){ + super(()); + } + +}class Blue { + +Blue(){ + super(()); + } + Blue(){ + super(()); + } + +}class Red { + +Red(){ + super(()); + } + Red(){ + super(()); + } + +}class PatternMatching { + +PatternMatching(){ + super(()); + } + void printColorOfUpperLeftPoint(Shape shape){ + switch(shape){ + case Rectangle(ColoredPoint(Point pt, java.lang.String color), ColoredPoint lowerRight): + System.out.println Signature: [TPH, TPH](x: op pt.x Signature: [TPH]() op / color: op color op / lowerRight: op lowerRight); + + default: + System.out.println Signature: [TPH, TPH](not a rectangle); + + }; + return; + } + + PatternMatching(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Plus.ast b/lib/resources/syntaxtreegenerator/Plus.ast new file mode 100644 index 0000000..c395f00 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Plus.ast @@ -0,0 +1,14 @@ +class Plus { + +Plus(){ + super(()); + } + TPH ACHZ m(TPH ACIA a, TPH ACIB b){ + return a op b; + } + + Plus(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Record.ast b/lib/resources/syntaxtreegenerator/Record.ast new file mode 100644 index 0000000..26d9587 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Record.ast @@ -0,0 +1,47 @@ +class Point { + + TPH x; + TPH y; +Point(TPH x, TPH y){ + super(()); + this.x = x; + this.y = y; + } + TPH x(){ + return this.x; + } + + TPH y(){ + return this.y; + } + + Point(TPH x, TPH y){ + super(()); + this.x = x; + this.y = y; + } + +}class Line { + + TPH pt1; + TPH pt2; +Line(TPH pt1, TPH pt2){ + super(()); + this.pt1 = pt1; + this.pt2 = pt2; + } + TPH pt1(){ + return this.pt1; + } + + TPH pt2(){ + return this.pt2; + } + + Line(TPH pt1, TPH pt2){ + super(()); + this.pt1 = pt1; + this.pt2 = pt2; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/RelOps.ast b/lib/resources/syntaxtreegenerator/RelOps.ast new file mode 100644 index 0000000..4b8fa1d --- /dev/null +++ b/lib/resources/syntaxtreegenerator/RelOps.ast @@ -0,0 +1,14 @@ +class RelOps { + +RelOps(){ + super(()); + } + TPH IPBY m(TPH IPBZ a, TPH IPCA b){ + return a op b; + } + + RelOps(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Scalar.ast b/lib/resources/syntaxtreegenerator/Scalar.ast new file mode 100644 index 0000000..fddde3a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Scalar.ast @@ -0,0 +1,29 @@ +class Scalar { + +Scalar(){ + super(()); + } + TPH KOXT mul(TPH KOXU v){ + TPH KOXV ret; + ret = 0; + TPH KOXX i; + i = 0; + while(i op this.size Signature: [TPH KOYB]()){ + ret = ret op this.elementAt Signature: [TPH KOYF, TPH KOYG](i) op v.elementAt Signature: [TPH KOYJ, TPH KOYK](i); + i = i op 1; + }; + return ret; + } + + Scalar(TPH KOWX v){ + super(()); + java.lang.Integer i; + i = 0; + while(i op v.size Signature: [TPH KOXA]()){ + this.add Signature: [TPH KOXI, TPH KOXJ](v.elementAt Signature: [TPH KOXE, TPH KOXF](i)); + i = i op 1; + }; + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Sealed.ast b/lib/resources/syntaxtreegenerator/Sealed.ast new file mode 100644 index 0000000..24423ca --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Sealed.ast @@ -0,0 +1,144 @@ +class Shape { + +Shape(){ + super(()); + } + Shape(){ + super(()); + } + +}class Circle { + +Circle(){ + super(()); + } + Circle(){ + super(()); + } + +}class Rectangle { + +Rectangle(){ + super(()); + } + Rectangle(){ + super(()); + } + +}class TransparentRectangle { + +TransparentRectangle(){ + super(()); + } + TransparentRectangle(){ + super(()); + } + +}class FilledRectangle { + +FilledRectangle(){ + super(()); + } + FilledRectangle(){ + super(()); + } + +}class Square { + +Square(){ + super(()); + } + Square(){ + super(()); + } + +}class WeirdShape { + +WeirdShape(){ + super(()); + } + WeirdShape(){ + super(()); + } + +}class Expr { + +}class ConstantExpr { + + java.lang.Integer i; +ConstantExpr(java.lang.Integer i){ + super(()); + this.i = i; + } + java.lang.Integer i(){ + return this.i; + } + + ConstantExpr(java.lang.Integer i){ + super(()); + this.i = i; + } + +}class PlusExpr { + + Expr a; + Expr b; +PlusExpr(Expr a, Expr b){ + super(()); + this.a = a; + this.b = b; + } + Expr a(){ + return this.a; + } + + Expr b(){ + return this.b; + } + + PlusExpr(Expr a, Expr b){ + super(()); + this.a = a; + this.b = b; + } + +}class TimesExpr { + + Expr a; + Expr b; +TimesExpr(Expr a, Expr b){ + super(()); + this.a = a; + this.b = b; + } + Expr a(){ + return this.a; + } + + Expr b(){ + return this.b; + } + + TimesExpr(Expr a, Expr b){ + super(()); + this.a = a; + this.b = b; + } + +}class NegExpr { + + Expr e; +NegExpr(Expr e){ + super(()); + this.e = e; + } + Expr e(){ + return this.e; + } + + NegExpr(Expr e){ + super(()); + this.e = e; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/SimpleCycle.ast b/lib/resources/syntaxtreegenerator/SimpleCycle.ast new file mode 100644 index 0000000..771757a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/SimpleCycle.ast @@ -0,0 +1,18 @@ +class SimpleCycle { + +SimpleCycle(){ + super(()); + } + TPH ETMJ m(){ + TPH ETMK g; + TPH ETML h; + g = h; + h = g; + return; + } + + SimpleCycle(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Sorting.ast b/lib/resources/syntaxtreegenerator/Sorting.ast new file mode 100644 index 0000000..979d268 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Sorting.ast @@ -0,0 +1,23 @@ +class Sorting { + +Sorting(){ + super(()); + } + TPH JNN merge(TPH JNO a, TPH JNP b){ + a.addAll Signature: [TPH JNQ, TPH JNR](b); + return a; + } + + TPH JNV sort(TPH JNW in){ + TPH JNX firstHalf; + firstHalf = in; + TPH JNY secondHalf; + secondHalf = in; + return this.merge Signature: [TPH JOK, TPH JOL, TPH JOM](this.sort Signature: [TPH JOB, TPH JOC](firstHalf), this.sort Signature: [TPH JOG, TPH JOH](secondHalf)); + } + + Sorting(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/SubMatrix.ast b/lib/resources/syntaxtreegenerator/SubMatrix.ast new file mode 100644 index 0000000..61ab2f2 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/SubMatrix.ast @@ -0,0 +1,26 @@ +class Matrix2 { + +Matrix2(){ + super(()); + } + Matrix2(){ + super(()); + } + +}class SubMatrix { + +SubMatrix(){ + super(()); + } + TPH DOFK m(){ + java.util.Vector v; + v = new java.util.Vector(); + v.add Signature: [TPH DOFN, TPH DOFO](1); + return; + } + + SubMatrix(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Switch.ast b/lib/resources/syntaxtreegenerator/Switch.ast new file mode 100644 index 0000000..f6dfd8f --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Switch.ast @@ -0,0 +1,96 @@ +class SwitchStatement { + +SwitchStatement(){ + super(()); + } + TPH switchStandard(){ + str = SwitchMe; + switch(str){ + case java.lang.String s: + return true; + + default: + return false; + + }; + } + + TPH switchInteger(){ + i = 5; + switch(i){ + case java.lang.Integer j: + case java.lang.String s: + i = 6; + break; + + default: + i = 0; + break; + + }; + return i op 0; + } + + TPH guardedPattern(){ + TPH i; + i = 1; + switch(i){ + case java.lang.Integer j: + return true; + + default: + return false; + + }; + } + + TPH recordPattern(java.lang.Object obj){ + switch(obj){ + case Coordinates(java.lang.Double lat, java.lang.Double lon): + return true; + + default: + return false; + + }; + } + + SwitchStatement(){ + super(()); + } + +}class SwitchExpression { + + java.lang.Integer x; + java.lang.Integer y; +SwitchExpression(java.lang.Integer x, java.lang.Integer y){ + super(()); + this.x = x; + this.y = y; + } + java.lang.Integer x(){ + return this.x; + } + + java.lang.Integer y(){ + return this.y; + } + + java.lang.Boolean switchStandard(TPH str){ + return switch(str){ + case java.lang.String s: + yield true; + + default: + yield false; + + }; + } + + SwitchExpression(java.lang.Integer x, java.lang.Integer y){ + super(()); + this.x = x; + this.y = y; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/TXGenerics.ast b/lib/resources/syntaxtreegenerator/TXGenerics.ast new file mode 100644 index 0000000..1c4a0ea --- /dev/null +++ b/lib/resources/syntaxtreegenerator/TXGenerics.ast @@ -0,0 +1,19 @@ +class TXGenerics { + + TPH GLEG a; + TPH GLEH b; +TXGenerics(){ + super(()); + } + TPH GLEI test(){ + TPH GLEJ c; + c = new Cycle(); + c.m Signature: [TPH GLEN, TPH GLEO, TPH GLEP](this.a, this.b); + return; + } + + TXGenerics(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph.ast b/lib/resources/syntaxtreegenerator/Tph.ast new file mode 100644 index 0000000..939f9a5 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph.ast @@ -0,0 +1,20 @@ +class Tph { + +Tph(){ + super(()); + } + TPH BNOP m(TPH BNOQ a, TPH BNOR b){ + TPH BNOS c; + c = this.m2 Signature: [TPH BNOU, TPH BNOV](b); + return a; + } + + TPH BNOZ m2(TPH BNPA b){ + return b; + } + + Tph(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph2.ast b/lib/resources/syntaxtreegenerator/Tph2.ast new file mode 100644 index 0000000..f138866 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph2.ast @@ -0,0 +1,18 @@ +class Tph2 { + + TPH FGYW id; +Tph2(){ + super(()); + this.id = (TPH FGYX x) -> { + return x; + }; + } + TPH FGZD id3(TPH FGZE x){ + return this.id.apply Signature: [TPH FGZG, TPH FGZH](x); + } + + Tph2(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph3.ast b/lib/resources/syntaxtreegenerator/Tph3.ast new file mode 100644 index 0000000..cfbf0bc --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph3.ast @@ -0,0 +1,21 @@ +class Tph3 { + +Tph3(){ + super(()); + } + TPH FMEJ m1(TPH FMEK x, TPH FMEL y){ + this.m2 Signature: [TPH FMEN, TPH FMEO](x); + x = y; + return; + } + + TPH FMES m2(TPH FMET y){ + this.m1 Signature: [TPH FMEV, TPH FMEW, TPH FMEX](y, y); + return; + } + + Tph3(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph4.ast b/lib/resources/syntaxtreegenerator/Tph4.ast new file mode 100644 index 0000000..2ed453b --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph4.ast @@ -0,0 +1,22 @@ +class Tph4 { + +Tph4(){ + super(()); + } + TPH FRJD m(TPH FRJE a, TPH FRJF b){ + TPH FRJG c; + c = this.m2 Signature: [TPH FRJI, TPH FRJJ](b); + TPH FRJM d; + d = this.m2 Signature: [TPH FRJO, TPH FRJP](c); + return d; + } + + TPH FRJT m2(TPH FRJU b){ + return b; + } + + Tph4(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph5.ast b/lib/resources/syntaxtreegenerator/Tph5.ast new file mode 100644 index 0000000..dfdda9d --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph5.ast @@ -0,0 +1,19 @@ +class Tph5 { + +Tph5(){ + super(()); + } + TPH FWNY m(TPH FWNZ x, TPH FWOA y){ + x = this.m2 Signature: [TPH FWOC, TPH FWOD](y); + return; + } + + TPH FWOH m2(TPH FWOI y){ + return y; + } + + Tph5(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph6.ast b/lib/resources/syntaxtreegenerator/Tph6.ast new file mode 100644 index 0000000..eba65bc --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph6.ast @@ -0,0 +1,21 @@ +class Tph6 { + +Tph6(){ + super(()); + } + TPH GBSM m(TPH GBSN x, TPH GBSO y){ + TPH GBSP c; + c = this.m2 Signature: [TPH GBSR, TPH GBSS](y); + c = this.m2 Signature: [TPH GBSW, TPH GBSX](x); + return; + } + + TPH GBTB m2(TPH GBTC y){ + return y; + } + + Tph6(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Tph7.ast b/lib/resources/syntaxtreegenerator/Tph7.ast new file mode 100644 index 0000000..8d2ebe4 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Tph7.ast @@ -0,0 +1,20 @@ +class Tph7 { + +Tph7(){ + super(()); + } + TPH GQRI m(TPH GQRJ a, TPH GQRK b){ + TPH GQRL c; + c = this.m2 Signature: [TPH GQRN, TPH GQRO](b); + return this.m2 Signature: [TPH GQRS, TPH GQRT](b); + } + + TPH GQRX m2(TPH GQRY b){ + return b; + } + + Tph7(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/TypedID.ast b/lib/resources/syntaxtreegenerator/TypedID.ast new file mode 100644 index 0000000..0a56861 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/TypedID.ast @@ -0,0 +1,22 @@ +class TypedID { + + TPH GVWK lam; +TypedID(){ + super(()); + this.lam = (TPH GVWL x) -> { + return x; + }; + } + TPH GVWR id(TPH GVWS b){ + return b; + } + + TPH GVWU m(){ + return this.lam; + } + + TypedID(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/VectorAdd.ast b/lib/resources/syntaxtreegenerator/VectorAdd.ast new file mode 100644 index 0000000..992c9c1 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/VectorAdd.ast @@ -0,0 +1,31 @@ +class VectorAdd { + +VectorAdd(){ + super(()); + } + TPH EXVJ vectorAdd(TPH EXVK v1, TPH EXVL v2){ + TPH EXVM i; + i = 0; + v1 = new java.util.Vector(); + TPH EXVP erg; + erg = new java.util.Vector(); + while(i op v1.size Signature: [TPH EXVT]()){ + erg.addElement Signature: [TPH EXWF, TPH EXWG](v1.elementAt Signature: [TPH EXVW, TPH EXVX](i) op v2.elementAt Signature: [TPH EXWA, TPH EXWB](i)); + i++; + }; + return erg; + } + + TPH EXWN m(TPH EXWO x, TPH EXWP y, TPH EXWQ z){ + x = new java.util.Vector(); + y = new java.util.Vector(); + x.add Signature: [TPH EXWU, TPH EXWV](1); + y.add Signature: [TPH EXWY, TPH EXWZ](2); + return z.addAll Signature: [TPH EXXC, TPH EXXD](x); + } + + VectorAdd(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/VectorSuper.ast b/lib/resources/syntaxtreegenerator/VectorSuper.ast new file mode 100644 index 0000000..ec2faf3 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/VectorSuper.ast @@ -0,0 +1,17 @@ +class VectorSuper { + +VectorSuper(){ + super(()); + } + TPH HPGR m(TPH HPGS x){ + java.lang.Integer y; + y = 1; + x.addElement Signature: [TPH HPGU, TPH HPGV](y); + return; + } + + VectorSuper(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/Y.ast b/lib/resources/syntaxtreegenerator/Y.ast new file mode 100644 index 0000000..6a73619 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/Y.ast @@ -0,0 +1,16 @@ +class Y { + + TPH IBFH y; +Y(){ + super(()); + } + Y(){ + super(()); + this.y = (TPH IBFK f) -> { + return (TPH IBFL t) -> { + return f.apply Signature: [TPH IBFR, TPH IBFS](this.y.apply Signature: [TPH IBFN, TPH IBFO](f)).apply Signature: [TPH IBFV, TPH IBFW](t); + }; + }; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/applyLambda.ast b/lib/resources/syntaxtreegenerator/applyLambda.ast new file mode 100644 index 0000000..504ddde --- /dev/null +++ b/lib/resources/syntaxtreegenerator/applyLambda.ast @@ -0,0 +1,27 @@ +class Apply { + +Apply(){ + super(()); + } + Apply(){ + super(()); + } + +}class applyLambda { + +applyLambda(){ + super(()); + } + TPH ASWH m(){ + TPH ASWI lam1; + lam1 = (TPH ASWJ x) -> { + return x; + }; + return lam1.apply Signature: [TPH ASWP, TPH ASWQ](new Apply()); + } + + applyLambda(){ + super(()); + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/javFiles/Instanceof.jav b/lib/resources/syntaxtreegenerator/javFiles/Instanceof.jav new file mode 100644 index 0000000..c9a2d0b --- /dev/null +++ b/lib/resources/syntaxtreegenerator/javFiles/Instanceof.jav @@ -0,0 +1,36 @@ +import java.lang.Integer; +import java.lang.Double; +import java.lang.String; +import java.lang.Object; + +public class Instanceof{ + void checkInstanceof() { + var a = 4; + return (a instanceof java.lang.Integer); + } + + void checkInstanceOfWithPattern(){ + var b = 4.0; + if(b instanceof java.lang.Double d){ + return d; + }else{ + return "Kein Double"; + } + } + + void checkInstanceOfWithGuardedPattern(){ + var obj = "test"; + var flag; + if (obj instanceof String s && s.length() > 5) { + flag = s.contains("jdk"); + } + } + + record Point(int x, int y){ } + + boolean equals(Object o) { + return (o instanceof Point other) + && x == other.x + && y == other.y; + } +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/javFiles/PatternMatching.jav b/lib/resources/syntaxtreegenerator/javFiles/PatternMatching.jav new file mode 100644 index 0000000..d256ac0 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/javFiles/PatternMatching.jav @@ -0,0 +1,19 @@ +import java.lang.String; + +record Point(int x, int y) {} +interface Shape {} +record ColoredPoint(Point pt, String color) {} +record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) implements Shape {} +sealed class Color permits Blue, Red {} +class Blue extends Color {} +class Red extends Color {} + +class PatternMatching { +void printColorOfUpperLeftPoint(Shape shape) +{ + switch (shape) { + case Rectangle(ColoredPoint(Point pt, String color), ColoredPoint lowerRight) -> System.out.println("x: " + pt.x() + " / color: " + color + " / lowerRight: " + lowerRight); + default -> System.out.println("not a rectangle"); + }; +} +} diff --git a/lib/resources/syntaxtreegenerator/javFiles/Record.jav b/lib/resources/syntaxtreegenerator/javFiles/Record.jav new file mode 100644 index 0000000..31edc83 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/javFiles/Record.jav @@ -0,0 +1,5 @@ +// Simple records +record Point(x, y){ } + +//Combination of records +record Line(pt1, pt2){} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/javFiles/Sealed.jav b/lib/resources/syntaxtreegenerator/javFiles/Sealed.jav new file mode 100644 index 0000000..b7a68e5 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/javFiles/Sealed.jav @@ -0,0 +1,21 @@ +public abstract sealed class Shape + permits Circle, Rectangle, Square, WeirdShape { } + +public final class Circle extends Shape { } + +public sealed class Rectangle extends Shape + permits TransparentRectangle, FilledRectangle { } +public final class TransparentRectangle extends Rectangle { } +public final class FilledRectangle extends Rectangle { } + +public final class Square extends Shape { } + +public non-sealed class WeirdShape extends Shape { } + +public sealed interface Expr + permits ConstantExpr, PlusExpr, TimesExpr, NegExpr { } + +public record ConstantExpr(int i) implements Expr { } +public record PlusExpr(Expr a, Expr b) implements Expr { } +public record TimesExpr(Expr a, Expr b) implements Expr { } +public record NegExpr(Expr e) implements Expr { } \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/javFiles/Switch.jav b/lib/resources/syntaxtreegenerator/javFiles/Switch.jav new file mode 100644 index 0000000..6c0f68a --- /dev/null +++ b/lib/resources/syntaxtreegenerator/javFiles/Switch.jav @@ -0,0 +1,52 @@ +import java.lang.Integer; +import java.lang.Boolean; +import java.lang.String; +import java.lang.Object; + +class SwitchStatement { + + switchStandard(){ + str = "SwitchMe"; + switch(str){ + case String s: return true; + default: return false; + } + } + + switchInteger(){ + i = 5; + switch(i){ + case Integer j: + case String s: i = 6; break; + default: i = 0; break; + } + return (i==0); + } + + guardedPattern(){ + var i = 1; + switch(i){ + case Integer j && j == 1: return true; + default: return false; + } + } + + record Coordinates(double x, double y) {} + + recordPattern(Object obj){ + switch(obj){ + case Coordinates(double lat, double lon): return true; + default: return false; + } + } +} + +record SwitchExpression(int x, int y){ + + boolean switchStandard(str){ + return switch(str){ + case String s -> yield true; + default -> yield false; + }; + } +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/mathStruc.ast b/lib/resources/syntaxtreegenerator/mathStruc.ast new file mode 100644 index 0000000..8531850 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/mathStruc.ast @@ -0,0 +1,19 @@ +class mathStruc { + + TPH IHHZ model; + TPH IHIA innerOp; +mathStruc(){ + super(()); + this.innerOp = (TPH IHIB o) -> { + return (TPH IHIC ms) -> { + return new mathStruc(o.apply Signature: [TPH IHIF, TPH IHIG, TPH IHIH](this.model, ms.model)); + }; + }; + } + mathStruc(TPH IHIW m){ + super(()); + this.model = m; + return; + } + +} \ No newline at end of file diff --git a/lib/resources/syntaxtreegenerator/mathStrucInteger.ast b/lib/resources/syntaxtreegenerator/mathStrucInteger.ast new file mode 100644 index 0000000..c36d537 --- /dev/null +++ b/lib/resources/syntaxtreegenerator/mathStrucInteger.ast @@ -0,0 +1,38 @@ +class mathStrucInteger { + + TPH EBJW model; + TPH EBJX innerOp; +mathStrucInteger(){ + super(()); + this.innerOp = (TPH EBJY o) -> { + return (TPH EBJZ ms) -> { + return new mathStrucInteger(o.apply Signature: [TPH EBKC, TPH EBKD, TPH EBKE](this.model, ms.model)); + }; + }; + } + mathStrucInteger(TPH EBKT m){ + super(()); + this.model = m; + return; + } + +}class mathStrucIntegerUse { + +mathStrucIntegerUse(){ + super(()); + } + TPH EBLO main(){ + TPH EBLP ms; + ms = new mathStrucInteger(2); + TPH EBLT ms2; + ms2 = ms.innerOp.apply Signature: [TPH EBMD, TPH EBME]((TPH EBLV x, TPH EBLW y) -> { + return x op y; + }).apply Signature: [TPH EBMH, TPH EBMI](ms); + return ms2; + } + + mathStrucIntegerUse(){ + super(()); + } + +} \ No newline at end of file diff --git a/test.sh b/test.sh index f37f3f6..68cad9d 100755 --- a/test.sh +++ b/test.sh @@ -4,12 +4,13 @@ DESTDIR="out/src" TESTDESTDIR="out/tests" DEPENDENCIES="dependencies/*" TESTFILES="TestComplete TestPackages GenericParserTest TestTypeDeployment finiteClosure.SuperInterfacesTest astfactory.ASTFactoryTest targetast.ASTToTypedTargetAST targetast.GreaterEqualTest targetast.GreaterThanTest targetast.InheritTest2 targetast.InheritTest targetast.LessEqualTest targetast.LessThanTest targetast.OLTest targetast.PostIncTest targetast.PreIncTest targetast.PutTest targetast.TestCodegen targetast.TestGenerics targetast.TphTest targetast.WhileTest" +RESOURCES="lib/resources" #compile all necessary test files -javac -cp "$TESTDESTDIR:$DESTDIR:$DEPENDENCIES" -d "out/tests" tests/**/*.java -javac -cp "$TESTDESTDIR:$DESTDIR:$DEPENDENCIES" -d "out/tests" tests/*.java +javac -cp "$TESTDESTDIR:$DESTDIR:$DEPENDENCIES" -d $TESTDESTDIR tests/**/*.java +javac -cp "$TESTDESTDIR:$DESTDIR:$DEPENDENCIES" -d $TESTDESTDIR tests/*.java -cp -r resources out/tests/resources/ +cp -r $RESOURCES $TESTDESTDIR/resources/ cd "$TESTDESTDIR"