add some lexer test programs
This commit is contained in:
0
src/test/resources/examples/EmptyFile.stups
Normal file
0
src/test/resources/examples/EmptyFile.stups
Normal file
6
src/test/resources/examples/EmptyMain.stups
Normal file
6
src/test/resources/examples/EmptyMain.stups
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class EmptyClass {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/test/resources/examples/GeneralComment.stups
Normal file
13
src/test/resources/examples/GeneralComment.stups
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Tolle Testklasse
|
||||||
|
class CommentClass {
|
||||||
|
|
||||||
|
// Das ist ein Kommentar
|
||||||
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* Wir testen hier einen Multiline Kommentar.
|
||||||
|
* Ziemlich lang.
|
||||||
|
*/
|
||||||
|
System.out.println("Test");
|
||||||
|
// Kommentar mit Code: int x = 45;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/test/resources/examples/GeneralIfElse.stups
Normal file
15
src/test/resources/examples/GeneralIfElse.stups
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
class IfElseClass {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
int x = 5;
|
||||||
|
int y = 10;
|
||||||
|
if (x < y) {
|
||||||
|
System.out.println("x ist kleiner als y.");
|
||||||
|
} else {
|
||||||
|
if (x > y) {
|
||||||
|
System.out.println("x ist groesser als y.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("x und y sind gleich gross.");
|
||||||
|
}
|
||||||
|
}
|
||||||
14
src/test/resources/examples/GeneralWhile.stups
Normal file
14
src/test/resources/examples/GeneralWhile.stups
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
class WhileClass {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
int a = 1;
|
||||||
|
int b = 1;
|
||||||
|
int temp = 0;
|
||||||
|
while (a < 144) {
|
||||||
|
temp = b;
|
||||||
|
b = a + b;
|
||||||
|
a = temp;
|
||||||
|
System.out.println(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
src/test/resources/examples/Whitespace.stups
Normal file
5
src/test/resources/examples/Whitespace.stups
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
TAB
|
||||||
|
SPC
|
||||||
|
|
||||||
|
CR
|
||||||
|
|
||||||
Reference in New Issue
Block a user