diff --git a/tests/2/mechant1.zwei b/tests/2/mechant1.zwei new file mode 100755 index 0000000..9b60707 --- /dev/null +++ b/tests/2/mechant1.zwei @@ -0,0 +1,18 @@ +class factoriel { + + String var1; + String toString(){ + var1 = 25; + if(x == -2) var1 -- 2 else var1 - 3; + var1 = 30; + var --2; + + while(-2 == -5){ + if(-4 == -6) var --2 else var + (-4 + -5); + var2 = (5- var2 ) + nimportequoi; + } + + } +} + +2 == 4 \ No newline at end of file diff --git a/tests/2/mechant2.zwei b/tests/2/mechant2.zwei new file mode 100755 index 0000000..838c529 --- /dev/null +++ b/tests/2/mechant2.zwei @@ -0,0 +1,7 @@ +class test{ + factoriel monfact; + + String toString() { + monfact.soString(4, 5, /*int*/ 5); + } +} \ No newline at end of file diff --git a/tests/2/mechant3.zwei b/tests/2/mechant3.zwei new file mode 100755 index 0000000..4d04e8e --- /dev/null +++ b/tests/2/mechant3.zwei @@ -0,0 +1,7 @@ +class test{ + factoriel monfact; + + String toString() { + monfact.soString(4, 5, int 5); + } +} \ No newline at end of file diff --git a/tests/2/mechant4.zwei b/tests/2/mechant4.zwei new file mode 100755 index 0000000..23126fb --- /dev/null +++ b/tests/2/mechant4.zwei @@ -0,0 +1,32 @@ +class A extends B { + //Check FieldDecl (-> also Formal) + Int a; + Int s; + Null z; + Object o; + boolean b; + + //Check MethodDef + Object method(Int i, Null n, Object oj) { + //Check Block (->also Statement and Expression) + while ( if ( i && !o) { return b} else { return !b}) { + b = true; + boolean c = false; + 3+2; + printInt (a); + printChar("toto et titi c'est tjs joli"); + } + + // Expression + if ( b) readInt else readChar; + if (-b) true else false; + if(a-b || c) null else ( a == b); + if (-new x (3,"HelloWorld") * ! { while ( a==b) { 4 //Comment + % 3 ; }return "viveJava"} / b && c) null; + + + return b + } +} + +7.a(b,c,d,e) \ No newline at end of file diff --git a/tests/2/mechant5.zwei b/tests/2/mechant5.zwei new file mode 100755 index 0000000..7e590fc --- /dev/null +++ b/tests/2/mechant5.zwei @@ -0,0 +1,30 @@ +//Fun with Expressions, Statements and Factors +//this file should be correct +class FunTest { + +formal formal() { + + ident.ident.ident.ident; + printInt({}); + printChar(!"a"); + + while ({}) {} + while (("da da da")) {this.dududu == true;} + while (34.da) {{};} + + if ( expr ) expr else expr; + + exrp == expr; + expr == term --factor * ! factor; + + {} == ({}); + {} && {} <= {}; + + {}.bla(); + {{};} * new bla ({return {return bla}}); + +} + +} + +test \ No newline at end of file diff --git a/tests/2/noclass.zwei b/tests/2/noclass.zwei new file mode 100755 index 0000000..de56a42 --- /dev/null +++ b/tests/2/noclass.zwei @@ -0,0 +1 @@ +temp + 2005; \ No newline at end of file diff --git a/tests/2/simple.zwei b/tests/2/simple.zwei index 6d30e65..fce8998 100755 --- a/tests/2/simple.zwei +++ b/tests/2/simple.zwei @@ -1 +1 @@ -hallo kacke; \ No newline at end of file +stupidhelloworld \ No newline at end of file