Compare commits

...

No commits in common. "targetBytecode" and "gradle" have entirely different histories.

1961 changed files with 27295 additions and 348985 deletions

9
.gitattributes vendored Normal file
View File

@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf

View File

@ -1,25 +0,0 @@
name: Build and Test with Maven
on: [push]
jobs:
Build-and-test-with-Maven:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install maven
run: |
apt update
apt install -y maven
- name: Install java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Compile project
run: |
mvn compile
- name: Run tests
run: |
mvn test

11
.gitignore vendored
View File

@ -19,9 +19,7 @@ bin
.DS_Store .DS_Store
.project .project
.settings/ .settings/
.vscode/
/target/ /target/
settings.json
# #
manually/ manually/
@ -31,3 +29,12 @@ logFiles/**
src/main/java/de/dhbwstuttgart/parser/antlr/ src/main/java/de/dhbwstuttgart/parser/antlr/
src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/ src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/
#GRADLE
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build

View File

@ -1,14 +0,0 @@
Stand: 24.5.21
bigRefactoring: Master-Brach
targetBytecode: Neuer Codegenerator mit generated generics Daniel
bigRefactoringUnifyComment: Dokumentation Unify, Martin
bytecodeGenericsSecond: Generated Generics, Ali, Martin
inferWildcards, Wildcards, Till
master, derzeit nicht genutzt
plugin, eigemntlicher Branch fuer Plugin-Basis, derzeit nicht aktuelle (aktuelle Version in simplifyRes
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
Stand 21.2.23
unif23: Testbranch fuer Tagungseinrecihung Unif23

BIN
app/.build.gradle.kts.swp Normal file

Binary file not shown.

53
app/build.gradle.kts Normal file
View File

@ -0,0 +1,53 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.6/userguide/building_java_projects.html
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
antlr
application
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(19))
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation("junit:junit:4.13.2")
// This dependency is used by the application.
implementation("com.google.guava:guava:31.1-jre")
implementation("commons-io:commons-io:2.6")
implementation("org.reflections:reflections:0.9.11")
implementation("org.ow2.asm:asm:7.0")
//implementation("org.antlr:antlr4:4.11.1")
antlr("org.antlr:antlr4:4.8-1")
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("--enable-preview")
}
tasks.withType<Test> {
jvmArgs("--enable-preview")
}
tasks.withType<JavaExec> {
jvmArgs("--enable-preview")
}
application {
// Define the main class for the application.
mainClass.set("de.dhbwstuttgart.App")
}

View File

@ -0,0 +1,13 @@
class Box<A>{
void m(A a){}
}
class B { }
class Box_Main extends B {
m(b) {
b.m(new Box_Main());
b.m(new B());
}
}

View File

@ -0,0 +1,13 @@
class Box<A>{
A f;
}
class B { }
class Box_Main extends B {//Fehler Bugzilla Bug 230
m(b) {
b.f = new Box_Main();
b.f = new B();
}
}

View File

@ -0,0 +1,12 @@
import java.util.Vector;
import java.util.List;
import java.lang.Integer;
class FCTest1 extends Vector<Vector<Integer>> {
fc1() {
var y;
var z;
y.add(z);
return y;
}
}

View File

@ -0,0 +1,11 @@
import java.util.Vector;
import java.util.List;
import java.lang.Integer;
class FCTest2 extends Vector<Vector<Integer>> {
fc2(y) {
var z;
y.add(z);
return y;
}
}

View File

@ -0,0 +1,19 @@
import java.util.Vector;
import java.lang.Integer;
class FCTest3 extends Pair<Vector<Integer>, Vector<Integer>> {
fc2(x) {
x.snd().addElement(2);
}
fc2a() {
var y;
y.snd().addElement(2);
return y;
}
}

View File

@ -0,0 +1,10 @@
import java.lang.Integer;
import java.util.Vector;
public class GenTest {
main(x) {
var v = new Vector();
return 1 + v.elementAt(0);
}
}

View File

@ -0,0 +1,9 @@
class Generics {
a;
id(b) { return b; }
setA(x) {
a = x;
return a;
}
m(x,y) { x = id(y); }
}

View File

@ -0,0 +1,7 @@
import java.util.List;
class M {
void m(p, p2){
new addList().addLists(p, p2);
}
}

View File

@ -0,0 +1,9 @@
import java.util.Stack;
import java.util.Vector;
class OverloadingMain {
mmMain(x) { var y; return new O1().mm(y); }
}

View File

@ -0,0 +1,20 @@
import java.lang.Integer;
public class Overloading_Generics {
id1 (x) { return x; }
//Integer id (Integer x) { return x; }
}
class Overloading_Generics1 {
main(x) {
var olg = new Overloading_Generics();
return olg.id1(1);
}
}

View File

@ -0,0 +1,25 @@
import java.util.Vector;
import java.util.Stack;
class OverrideMain {
ovrMain(x) {
var overide;
overide.ovr(x);
}
}
/*
[
[(TPH L = java.util.Stack<TPH FTM>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH FTN, TPH FTM), (TPH K = void)],
[(TPH FTO, TPH FTP), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Stack<TPH FTP>), (TPH K = void)],
[(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH K = void), (TPH FTR, TPH FTQ), (TPH L = java.util.Vector<TPH FTQ>)],
[(TPH FTT, TPH FTS), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTS>), (TPH K = void), (TPH N = java.lang.String)],
[(TPH L = java.util.Vector<TPH FTV>), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH FTU, TPH FTV), (TPH K = void)],
[(TPH FTX, TPH FTW), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTW>), (TPH K = void), (TPH N = java.lang.String)],
[(TPH M = ? extends Override2), (TPH L = java.util.Stack<TPH FTZ>), (TPH K = void), (TPH FTY, TPH FTZ), (TPH N = java.lang.String)],
[(TPH FUB, TPH FUA), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUA>)],
[(TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUC>), (TPH FUD, TPH FUC), (TPH M = ? extends Override2), (TPH K = void)],
[(TPH N = java.lang.String), (TPH FUF, TPH FUE), (TPH M = ? extends Override2), (TPH K = void), (TPH L = java.util.Vector<TPH FUE>)]]
[[(TPH M = ? extends Override2), (TPH MNX, TPH MNY), (TPH N = java.lang.String), (TPH K = void), (TPH L = java.util.Stack<TPH MNY>)], [(TPH L = java.util.Stack<TPH MOC>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH K = void), (TPH MOB, TPH MOC)], [(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH MNZ, TPH MOA), (TPH L = java.util.Vector<TPH MOA>), (TPH K = void)], [(TPH L = java.util.Vector<TPH MOE>), (TPH K = void), (TPH M = ? extends Override2), (TPH MOD, TPH MOE), (TPH N = java.lang.String)], [(TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String), (TPH MOF, TPH MOG), (TPH L = java.util.Stack<TPH MOG>)], [(TPH L = java.util.Vector<TPH MOI>), (TPH K = void), (TPH MOH, TPH MOI), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOK>), (TPH MOJ, TPH MOK), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH MOL, TPH MOM), (TPH L = java.util.Stack<TPH MOM>), (TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOO>), (TPH MON, TPH MOO), (TPH N = java.lang.String), (TPH K = void), (TPH M = ? extends Override2)], [(TPH L = java.util.Stack<TPH MOP>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH MOQ, TPH MOP), (TPH K = void)]]
*/

View File

@ -0,0 +1,11 @@
import java.util.Vector;
import java.util.Stack;
class OverrideMainRet {
ovrMain() {
var overide;
var x;
overide.ovr(x);
return x;
}
}

View File

@ -0,0 +1,18 @@
class Pair<T, U> {
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;
}
}

View File

@ -0,0 +1,19 @@
import java.util.Vector;
import java.util.Stack;
class Put {
putElement(ele, v) {
v.addElement(ele);
}
putElement(ele, s) {
s.push(ele);
}
main(ele, x) {
putElement(ele, x);
}
}

View File

@ -0,0 +1,4 @@
class Test {
a;
Test b;
}

View File

@ -0,0 +1,12 @@
import java.util.ArrayList;
class TestSubTypless {
m(a){
var l = new ArrayList<>();
l.add(a);
return m2(l).get(0);
}
m2(a){
return m(a);
}
}

View File

@ -0,0 +1,3 @@
class Twice {
twice = f -> x -> f.apply(f.apply(x));
}

View File

@ -0,0 +1,5 @@
class Var {
var(x) { var y; }
}

View File

@ -0,0 +1,15 @@
import java.util.Vector;
import java.lang.Integer;
public class VectorConstAdd {
vectorAdd(v1) {
var i = 0;
var erg = new Vector<>();
while (i < v1.size()) {
erg.addElement(v1.elementAt(i) + 1);
i++;
}
return erg;
}
}

View File

@ -0,0 +1,8 @@
class Wildcard_Andi {
Test<? extends A> ex = new Test<>();
Test<? super A> sup = new Test<>();
}

View File

@ -0,0 +1,8 @@
import java.util.List;
class addList {
addLists(a, b){
a.add(b.get(0));
b.add(a.get(0));
}
}

View File

@ -0,0 +1,22 @@
import java.util.List;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Boolean;
class wildcardPair {
make(l) {
var p = new Pair(l.get(0), l.get(1));
return p;
}
//<X>Boolean compare(Pair<X, X> x) { return true; }
void m(l) {
Object o = l.get(0);
//Pair<? extends Object, ? extends Object> p;
//List<?> b;
//this.compare(p); //1, type incorrect
make(l);
//this.compare(this.make(b)); //2, OK
}
}

View File

@ -0,0 +1,8 @@
import java.lang.Integer;
import java.lang.String;
public class AA {
m(Integer i) { return "AA"; }
m2(AA x) { return "AA"; }
}

View File

@ -0,0 +1,3 @@
import java.lang.Integer;
public class BB extends AA { }

View File

@ -3,15 +3,15 @@ import java.lang.Double;
public class BinaryInMeth { public class BinaryInMeth {
public m(a){ m(a){
return ++a; return ++a;
} }
public m2(a,b){ m2(a,b){
return m(a+b); return m(a+b);
} }
public m3(a) { m3(a) {
return m(++a); return m(++a);
} }
} }

View File

@ -1,11 +1,11 @@
import java.lang.Integer; import java.lang.Integer;
import java.lang.String; import java.lang.String;
import BB;
public class CC extends BB { public class CC extends BB {
public m(Integer i) { m(Integer i) {
return "CC"; return "CC";
} }
public m2(CC x) { return "CC"; } m2(CC x) { return "CC"; }
} }

View File

@ -0,0 +1,6 @@
class Cycle {
m(x, y) {
y = x;
x = y;
}
}

View File

@ -1,5 +1,4 @@
import java.lang.Integer; import java.lang.Integer;
import CC;
public class DD extends CC { } public class DD extends CC { }

View File

@ -0,0 +1,3 @@
public class Exceptions {
// m(Integer i) throws
}

View File

@ -1,12 +1,12 @@
import java.lang.Integer; import java.lang.Integer;
import java.lang.Double; //import java.lang.Double;
import java.lang.String;
public class Fac { public class Fac {
getFac(n) {
getFac(n){
var res = 1; var res = 1;
var i = 1; var i = 1;
while (i <= n) { while(i<=n) {
res = res * i; res = res * i;
i++; i++;
} }

View File

@ -17,7 +17,7 @@ public class Faculty {
public getFact(java.lang.Integer x) { public getFact(x) {
return fact.apply(x); return fact.apply(x);
} }
} }

View File

@ -0,0 +1,12 @@
public class FieldTph2 {
a;
m(b){
b = a;
return b;
}
m2(c){
a = c;
}
}

View File

@ -1,20 +1,20 @@
public class FieldTphConsMeth { public class FieldTphConsMeth {
public a; a;
public FieldTphConsMeth(c) { public FieldTphConsMeth(c) {
a = id(c); a = id(c);
} }
public id(b) { id(b) {
return b; return b;
} }
public setA(x) { setA(x) {
a = x; a = x;
return a; return a;
} }
public m(x,y) { m(x,y) {
x = id(y); x = id(y);
} }

View File

@ -1,13 +1,13 @@
import java.lang.Boolean; import java.lang.Boolean;
public class FieldTphMMeth { public class FieldTphMMeth {
public a; a;
public FieldTphMMeth(c,d,e) { public FieldTphMMeth(c,d,e) {
a = m(c,d,e); a = m(c,d,e);
} }
public m(b,d,e) { m(b,d,e) {
if(e) { if(e) {
return m3(b); return m3(b);
} else{ } else{
@ -16,11 +16,11 @@ public class FieldTphMMeth {
} }
public m2(b) { m2(b) {
a = m3(b); a = m3(b);
} }
public m3(b){ m3(b){
return b; return b;
} }

View File

@ -0,0 +1,30 @@
import java.lang.Integer;
import java.lang.Boolean;
class For{
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;
// }
return c;
// for(int i = 0;i<10;i++) {
// x = x + 5;
// }
}
// m2(Integer x){
// if(x<2) {
// return 1;
// }else {
// return 2;
// }
// }
}

View File

@ -0,0 +1,6 @@
class Generics2<B extends String>{
<B extends Integer> B m1(B b){
return b;
}
}

View File

@ -1,4 +1,4 @@
public class Id <FAU> { public class Id {
// a; // a;
// id(b){ // id(b){
// return b; // return b;

View File

@ -10,10 +10,6 @@ public class Inf {
w=y; w=y;
y=a; y=a;
b=a; b=a;
var c;
var d;
c = v;
d = v;
} }
} }
@ -29,27 +25,21 @@ TPH M m(TPH N x, TPH O y, TPH P a)({
(w)::TPH S = (y)::TPH O; (w)::TPH S = (y)::TPH O;
(y)::TPH O = (a)::TPH P; (y)::TPH O = (a)::TPH P;
(b)::TPH T = (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; return;
})::TPH W })::TPH U
Inf()({ Inf()({
super(()); super(());
})::TPH Z })::TPH X
} }
// c::U d::V // v::R w::S
// \ /
// v::R w::S
// \ / // \ /
// z::Q y::O b::T // z::Q y::O b::T
// \ / \ / // \ / \ /
// x::N a::P // 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)]] RESULT Final: [[(TPH O < TPH S), (TPH P < TPH O), (TPH O < TPH R), (TPH P < TPH T), (TPH M = void), (TPH N < TPH O), (TPH N < TPH Q)]]
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)] 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)] 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: [] Class Inf: []

View File

@ -2,18 +2,15 @@ import java.util.Vector;
import java.lang.Integer; import java.lang.Integer;
import java.lang.String; import java.lang.String;
import AA;
import BB;
import CC;
import DD;
public class Inherit { public class Inherit {
public main(d, i) { main(d, i) {
return d.m(i); return d.m(i);
} }
public main(v, i) { main(v, i) {
var aa = v.elementAt(0); var aa = v.elementAt(0);
return aa.m(i); return aa.m(i);
} }

View File

@ -2,18 +2,15 @@ import java.util.Vector;
import java.lang.Integer; import java.lang.Integer;
import java.lang.String; import java.lang.String;
import AA;
import BB;
import CC;
import DD;
public class Inherit2 { public class Inherit2 {
public main(d) { main(d) {
return d.m2(d); return d.m2(d);
} }
public main(v) { main(v) {
var aa = v.elementAt(0); var aa = v.elementAt(0);
return aa.m2(aa); return aa.m2(aa);
} }

View File

@ -0,0 +1,9 @@
public class LamRunnable{
public LamRunnable(){
Runnable lam = () -> {System.out.println("lambda");};
lam.run();
}
}

View File

@ -2,7 +2,7 @@ import java.lang.Integer;
public class Lambda { public class Lambda {
public m() { m () {
var lam1 = (x) -> { var lam1 = (x) -> {
return x; return x;
}; };

View File

@ -4,52 +4,52 @@ import java.lang.Float;
import java.lang.Double; import java.lang.Double;
public class LessEqual { public class LessEqual {
public lessEqual(Integer a, Integer b){ lessEqual(Integer a, Integer b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Long a, Long b){ lessEqual(Long a, Long b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Float a, Float b){ lessEqual(Float a, Float b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Double a, Double b){ lessEqual(Double a, Double b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Long a, Integer b){ lessEqual(Long a, Integer b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Float a, Integer b){ lessEqual(Float a, Integer b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Double a, Integer b){ lessEqual(Double a, Integer b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Float a, Long b){ lessEqual(Float a, Long b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Double a, Long b){ lessEqual(Double a, Long b){
var c = a<=b; var c = a<=b;
return c; return c;
} }
public lessEqual(Double a, Float b){ lessEqual(Double a, Float b){
var c = a<=b; var c = a<=b;
return c; return c;
} }

View File

@ -5,52 +5,52 @@ import java.lang.Double;
public class LessThan { public class LessThan {
public lessThan(Integer a, Integer b){ lessThan(Integer a, Integer b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Long a, Long b){ lessThan(Long a, Long b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Float a, Float b){ lessThan(Float a, Float b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Double a, Double b){ lessThan(Double a, Double b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Long a, Integer b){ lessThan(Long a, Integer b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Float a, Integer b){ lessThan(Float a, Integer b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Double a, Integer b){ lessThan(Double a, Integer b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Float a, Long b){ lessThan(Float a, Long b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Double a, Long b){ lessThan(Double a, Long b){
var c = a<b; var c = a<b;
return c; return c;
} }
public lessThan(Double a, Float b){ lessThan(Double a, Float b){
var c = a<b; var c = a<b;
return c; return c;
} }

View File

@ -1,8 +1,6 @@
import java.util.List;
import java.util.AbstractList;
import java.util.Vector; import java.util.Vector;
import java.lang.Integer; import java.lang.Integer;
//import java.lang.Float; import java.lang.Float;
//import java.lang.Byte; //import java.lang.Byte;
//import java.lang.Boolean; //import java.lang.Boolean;
@ -11,7 +9,7 @@ public class Matrix extends Vector<Vector<Integer>> {
Matrix () { Matrix () {
} }
public Matrix(vv) { Matrix(vv) {
Integer i; Integer i;
i = 0; i = 0;
while(i < vv.size()) { while(i < vv.size()) {
@ -21,7 +19,7 @@ public class Matrix extends Vector<Vector<Integer>> {
} }
} }
public mul(m) { mul(m) {
var ret = new Matrix(); var ret = new Matrix();
var i = 0; var i = 0;
while(i < size()) { while(i < size()) {
@ -32,8 +30,8 @@ public class Matrix extends Vector<Vector<Integer>> {
var erg = 0; var erg = 0;
var k = 0; var k = 0;
while(k < v1.size()) { while(k < v1.size()) {
erg = erg + v1.get(k) erg = erg + v1.elementAt(k)
* m.get(k).get(j); * m.elementAt(k).elementAt(j);
k++; } k++; }
// v2.addElement(new Integer(erg)); // v2.addElement(new Integer(erg));
v2.addElement(erg); v2.addElement(erg);

View File

@ -8,7 +8,7 @@ public class MatrixOP extends Vector<Vector<Integer>> {
MatrixOP () { MatrixOP () {
} }
public MatrixOP(vv) { MatrixOP(vv) {
Integer i; Integer i;
i = 0; i = 0;
while(i < vv.size()) { while(i < vv.size()) {

View File

@ -2,16 +2,16 @@ import java.util.List;
import java.lang.Integer; import java.lang.Integer;
//import java.util.Collection; //import java.util.Collection;
public class Merge { class Merge {
public merge(a, b) { merge(a, b) {
a.addAll(b); a.addAll(b);
return a; return a;
} }
public sort(in){ sort(in){
var firstHalf = in.subList(1,2); var firstHalf = in.subList(1,2);
var secondHalf = in.subList(1,2); var secondHalf = in.subList(1,2);
return merge(sort(firstHalf), sort(secondHalf)); return merge(sort(firstHalf), sort(secondHalf));

View File

@ -0,0 +1,32 @@
import java.lang.String;
import java.lang.Integer;
import java.lang.Double;
import java.lang.Boolean;
//import java.util.Vector;
public class OL {
java.lang.Double m(java.lang.Double x) { return x + x; }
java.lang.Integer m(java.lang.Integer x) { return x + x; }
java.lang.String m(java.lang.String x) { return x + x; }
java.lang.Boolean m(Boolean x) { return x; }
// if the class contains just this method, then correct BC will be generated.
// But if another methods are contained then the generated BC is not correct
// m(x) {
// //x.add(1);
// x.addAll(x);
// return x;
// }
}
public class OLMain {
main(x) {
var ol;
ol = new OL();
return ol.m(x);
}
}

View File

@ -9,11 +9,5 @@ public class OLFun {
//f = x -> {return x + x;}; //f = x -> {return x + x;};
m(f, x) { m(f, x) {
x = f.apply(x+x); x = f.apply(x+x);
return x;
}
m2(y) {
m(x -> x * 2, y);
return;
} }
} }

View File

@ -8,6 +8,6 @@ public class OLFun2 {
x; x;
m(f){ m(f){
x = f.apply(x + x); x = f.apply(x + x)
} }
} }

View File

@ -1,17 +1,11 @@
import java.lang.Integer; import java.lang.Integer;
import java.lang.Double;
import java.lang.String; import java.lang.String;
public class Op2 { public class Op2 {
public m(){ m(){
var x = ""; var x = "";
var a = 5+x; var a = 5+x;
Integer x = 10;
Double y = 10.5;
var a = x - y;
return a; return a;
} }
} }

View File

@ -2,17 +2,17 @@ import java.lang.String;
public class Overloading{ public class Overloading{
public test(x){ test(x){
return x.methode(); return x.methode();
} }
public methode(){ methode(){
return "Overloading"; return "Overloading";
} }
} }
public class Overloading2{ public class Overloading2{
public methode(){ methode(){
return "Overloading2"; return "Overloading2";
} }
} }

View File

@ -3,7 +3,7 @@ import java.lang.String;
public class Plus { public class Plus {
public m(a,b) { m(a,b) {
return a+b; return a+b;
} }
} }

View File

@ -1,25 +1,25 @@
import java.lang.Integer; import java.lang.Integer;
public class PostIncDec { public class PostIncDec {
public m() { m() {
var i = 0; var i = 0;
i++; i++;
return i; return i;
} }
public m2() { m2() {
var i = 0; var i = 0;
var j = i++; var j = i++;
return j; return j;
} }
public d() { d() {
var i = 0; var i = 0;
i--; i--;
return i; return i;
} }
public d2() { d2() {
var i = 0; var i = 0;
var j = i--; var j = i--;
return j; return j;

View File

@ -1,25 +1,25 @@
import java.lang.Integer; import java.lang.Integer;
public class PreInc { public class PreInc {
public m() { m() {
var i = 0; var i = 0;
++i; ++i;
return i; return i;
} }
public m2() { m2() {
var i = 0; var i = 0;
var j = ++i; var j = ++i;
return j; return j;
} }
public d() { d() {
var i = 0; var i = 0;
--i; --i;
return i; return i;
} }
public d2() { d2() {
var i = 0; var i = 0;
var j = --i; var j = --i;
return j; return j;

View File

@ -3,16 +3,16 @@ import java.util.Stack;
public class Put { public class Put {
public putElement(ele, v) { putElement(ele, v) {
v.addElement(ele); v.addElement(ele);
} }
public putElement(ele, s) { putElement(ele, s) {
s.push(ele); s.push(ele);
} }
public main(ele, x) { main(ele, x) {
putElement(ele, x); putElement(ele, x);
} }

View File

@ -2,7 +2,7 @@ import java.lang.Integer;
import java.lang.Boolean; import java.lang.Boolean;
public class RelOps { public class RelOps {
public m(a,b){ m(a,b){
return a<b; return a<b;
} }
} }

View File

@ -1,6 +1,6 @@
public class SimpleCycle { public class SimpleCycle {
m(){ m(a,b,d){
var g; var g;
var h; var h;
g = h; g = h;

View File

@ -1,11 +1,11 @@
public class Tph { public class Tph {
public m(a,b){ m(a,b){
var c = m2(b); var c = m2(b);
return a; return a;
} }
public m2(b){ m2(b){
return b; return b;
} }
} }

View File

@ -0,0 +1,18 @@
public class Tph2 {
id = x->x;
id3 (x) {
return id.apply(x);
}
/*
m(a,b){
var c = m2(a,b);
//m2(a,b);
return a;
}
m2(a,b){
return b;
}
*/
}

Some files were not shown because too many files have changed in this diff Show More