add some lexer test programs

This commit is contained in:
ChUrl
2020-12-03 19:57:48 +01:00
parent 70daa64d38
commit b6e29730d2
6 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,6 @@
class EmptyClass {
public static void main(String[] args) {
}
}

View 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;
}
}

View 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.");
}
}

View 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);
}
}
}

View File

@ -0,0 +1,5 @@
TAB
SPC
CR