init
authorBernhard Urban <lewurm@gmail.com>
Tue, 23 Mar 2010 01:12:07 +0000 (02:12 +0100)
committerBernhard Urban <lewurm@gmail.com>
Tue, 23 Mar 2010 01:12:07 +0000 (02:12 +0100)
README [new file with mode: 0644]
parser/lewurm_00.0 [new file with mode: 0644]
parser/lewurm_02.1 [new file with mode: 0644]
parser/lewurm_03.2 [new file with mode: 0644]
scanner/lewurm_00.0 [new file with mode: 0644]
scanner/lewurm_00.out [new file with mode: 0644]
scanner/lewurm_01.0 [new file with mode: 0644]
scanner/lewurm_01.out [new file with mode: 0644]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..d6a4d6d
--- /dev/null
+++ b/README
@@ -0,0 +1,33 @@
+Dies ist eine gemeinschaftliche Sammlung von Testfaellen fuer die Uebungsbeispiele
+der LVA "Uebersetzerbau (SS10)".
+
+kurzes HOWTO:
+$ git clone $URL ~/test
+
+danach koennen die Testfaelle durch diesen Befehl aktualisiert werden:
+$ cd ~/test && git pull
+
+Das Testskript selbst wird von der LVA-Leitung zur Verfuegung gestellt:
+$ /usr/ftp/pub/ubvl/test/scanner/test
+$ /usr/ftp/pub/ubvl/test/parser/test
+$ /usr/ftp/pub/ubvl/test/ag/test
+
+
+Namenskonventionen fuer das Skript:
+Die Dateien mit der Eingabe heissen *.0, *.1, *.2 oder *.3, wobei die
+Ziffer hinten den Exit-Code angibt. Eine Datei, die einen
+Syntax-Fehler enthaelt, werden Sie also z.B. foo.2 nennen.  Beim
+Scanner-Beispiel gibt es fuer akzeptable Eingaben (also Dateien, die
+auf .0 enden) auch noch eine Ausgabe, die ueberprueft werden muss; die
+erwartete Ausgabe fuer die Datei bar.0 nennen Sie bar.out.
+
+Namenskonventionen fuer uns:
+Jeder Testfall wird hat als Praefix "<nick>_", sodass keine Namenskonflikte enstehen.
+
+
+Wie kannst du beitragen?
+* forke das Repository auf github, committe deine Aenderungen und mach einen pull request
+* klone das Repository, committe deine Aenderungen, erzeuge patches mit git format-patch und maile sie 
+* schicke deine Testfaelle per mail (mit passenden Dateinamen bitte!)
+* poste deine Testfaelle und haenge sie als Attachment an (mit passenden Dateinamen bitte!)
+
diff --git a/parser/lewurm_00.0 b/parser/lewurm_00.0
new file mode 100644 (file)
index 0000000..50185ad
--- /dev/null
@@ -0,0 +1,34 @@
+struct _mystruct1 ___mystruct2 mystruct3 end;
+method f ()
+       var muh := 0x10;
+       muh := muh * (9 - 0x4);
+       /* test comment */
+       /* ganz
+       vieeeeeeeeeel
+       kommentar
+       
+       
+       */
+       if (muh = -0x5) then
+               muh := muh * -2;
+       else
+               muh := 0x55;
+               f();
+       end;
+
+       while (muh < 10) do
+               muh := muh *      ((((((((((((-2))))))))))));
+       end;
+
+       /* warum geht das nciht? */
+       while (muh < 10) do
+               muh := muh--2;
+       end;
+
+       mystruct.hu := muh;
+       mystruct.check_i_ned := muh;
+
+       this.bla := wtf;
+
+       return muh;
+end;
diff --git a/parser/lewurm_02.1 b/parser/lewurm_02.1
new file mode 100644 (file)
index 0000000..48d19b3
--- /dev/null
@@ -0,0 +1,4 @@
+method f ()
+       var muh # 0x10;
+       muh := muh * -2;
+end;
diff --git a/parser/lewurm_03.2 b/parser/lewurm_03.2
new file mode 100644 (file)
index 0000000..a59ac9c
--- /dev/null
@@ -0,0 +1,4 @@
+method f ()
+       var muh := 0x10;
+       muh = muh * -2;
+end;
diff --git a/scanner/lewurm_00.0 b/scanner/lewurm_00.0
new file mode 100644 (file)
index 0000000..9ab5ac8
--- /dev/null
@@ -0,0 +1,11 @@
+method blabb
+var foo := 5;
+if foo < 0x0F3 then
+ /* hier
+  kommt komm
+ mentar
+ */
+ foo := foo - 0x3;
+else
+ foo := foo * 4;
+end
diff --git a/scanner/lewurm_00.out b/scanner/lewurm_00.out
new file mode 100644 (file)
index 0000000..ad769d9
--- /dev/null
@@ -0,0 +1,26 @@
+method
+ident blabb
+var
+ident foo
+:=
+num 5
+;
+if
+ident foo
+<
+num f3
+then
+ident foo
+:=
+ident foo
+-
+num 3
+;
+else
+ident foo
+:=
+ident foo
+*
+num 4
+;
+end
diff --git a/scanner/lewurm_01.0 b/scanner/lewurm_01.0
new file mode 100644 (file)
index 0000000..8e1597a
--- /dev/null
@@ -0,0 +1,7 @@
+method blabb
+var foo := 5;
+if foo < 0x0F3 then
+ foo := foo - 0x3;
+else
+ foo := foo * 4;
+end
diff --git a/scanner/lewurm_01.out b/scanner/lewurm_01.out
new file mode 100644 (file)
index 0000000..ad769d9
--- /dev/null
@@ -0,0 +1,26 @@
+method
+ident blabb
+var
+ident foo
+:=
+num 5
+;
+if
+ident foo
+<
+num f3
+then
+ident foo
+:=
+ident foo
+-
+num 3
+;
+else
+ident foo
+:=
+ident foo
+*
+num 4
+;
+end