Merge branch 'master' of git://github.com/skinner33/testub10
authorBernhard Urban <lewurm@gmail.com>
Wed, 31 Mar 2010 14:19:16 +0000 (16:19 +0200)
committerBernhard Urban <lewurm@gmail.com>
Wed, 31 Mar 2010 14:19:16 +0000 (16:19 +0200)
38 files changed:
README
ag/lewurm_00.3 [new file with mode: 0644]
ag/lewurm_01.3 [new file with mode: 0644]
ag/lewurm_02.3 [new file with mode: 0644]
ag/lewurm_03.0 [new file with mode: 0644]
ag/lewurm_04.0 [new file with mode: 0644]
ag/lewurm_05.0 [new file with mode: 0644]
ag/lewurm_06.3 [new file with mode: 0644]
ag/lewurm_07.0 [new file with mode: 0644]
ag/lewurm_08.0 [new file with mode: 0644]
ag/nax_00.0 [new file with mode: 0644]
ag/nax_01.0 [new file with mode: 0644]
ag/nax_02.0 [new file with mode: 0644]
ag/nax_03.2 [new file with mode: 0644]
ag/nax_04.0 [new file with mode: 0644]
ag/nax_05.2 [new file with mode: 0644]
ag/nax_06.0 [new file with mode: 0644]
ag/nax_07.0 [new file with mode: 0644]
ag/nax_08.0 [new file with mode: 0644]
ag/nax_09.3 [new file with mode: 0644]
ag/nax_10.0 [new file with mode: 0644]
ag/nax_11.0 [new file with mode: 0644]
ag/nax_12.3 [new file with mode: 0644]
ag/nax_14.3 [new file with mode: 0644]
parser/kersm00.2 [deleted file]
parser/kersm_00.2 [new file with mode: 0644]
parser/lewurm_04.0 [new file with mode: 0644]
parser/lewurm_05.0 [new file with mode: 0644]
parser/lewurm_06.2 [new file with mode: 0644]
parser/lewurm_07.0 [new file with mode: 0644]
parser/lewurm_08.0 [new file with mode: 0644]
scanner/bayer_00.0 [new file with mode: 0644]
scanner/bayer_00.out [new file with mode: 0644]
scanner/kersm00.0 [deleted file]
scanner/kersm00.out [deleted file]
scanner/kersm_00.0 [new file with mode: 0644]
scanner/kersm_00.out [new file with mode: 0644]
scanner/kersm_01.1 [new file with mode: 0644]

diff --git a/README b/README
index 7a61a50300fd3f36c226b9c31733a4179cd41bd3..b89289446dda31b8a5a1e8e07bb1b366d1191d85 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Dies ist eine gemeinschaftliche Sammlung von Testfaellen fuer die Uebungsbeispiele
 der LVA "Uebersetzerbau (SS10)".
 
-Kurzes HOWTO:
+Kurzes HOWTO (fuer die g0):
 $ git clone git://github.com/lewurm/testub10.git ~/test
 
 Danach koennen die Testfaelle durch diesen Befehl aktualisiert werden:
@@ -22,7 +22,7 @@ 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.
+Jeder Testfall hat als Praefix "<nick>_", sodass keine Namenskonflikte entstehen.
 
 
 Wie kannst du beitragen?
diff --git a/ag/lewurm_00.3 b/ag/lewurm_00.3
new file mode 100644 (file)
index 0000000..25e8e2f
--- /dev/null
@@ -0,0 +1,6 @@
+method f(a b c)
+       /* x nicht deklariert */
+       if a < x then
+               c := 0x1;
+       end;
+end;
diff --git a/ag/lewurm_01.3 b/ag/lewurm_01.3
new file mode 100644 (file)
index 0000000..eda05e0
--- /dev/null
@@ -0,0 +1,8 @@
+method f(a b c)
+       if a < b then
+               var x := 0;
+               c := 1;
+       end;
+       /* x ist nicht im scope */
+       x := x - 1;
+end;
diff --git a/ag/lewurm_02.3 b/ag/lewurm_02.3
new file mode 100644 (file)
index 0000000..c5fc09a
--- /dev/null
@@ -0,0 +1,4 @@
+method f(a b c)
+       /* x ist (noch) nicht im scope */
+       var x := x - 1;
+end;
diff --git a/ag/lewurm_03.0 b/ag/lewurm_03.0
new file mode 100644 (file)
index 0000000..ae12764
--- /dev/null
@@ -0,0 +1,5 @@
+struct a end;
+method f(c s)
+       /* lesender feldzugriff */
+       var b := c*(s.a - 1);
+end;
diff --git a/ag/lewurm_04.0 b/ag/lewurm_04.0
new file mode 100644 (file)
index 0000000..7bb46a6
--- /dev/null
@@ -0,0 +1,9 @@
+struct a d end;
+method f(b c s)
+       var t := 0;
+       /* lesender feldzugriff */
+       b := c*(s.a - 1);
+       b := c*(s.d - 1);
+       b := c*(t.a - 1);
+       b := c*(t.d - 1);
+end;
diff --git a/ag/lewurm_05.0 b/ag/lewurm_05.0
new file mode 100644 (file)
index 0000000..709f525
--- /dev/null
@@ -0,0 +1,10 @@
+struct a c d end;
+method f(b c s)
+       var t := 0;
+       /* lesender feldzugriff */
+       b := c*(s.a - 1);
+       b := c*(s.d - 1);
+       b := c*(t.a - 1);
+       /* auch gueltig, da structs und vars unterschiedlichen scope haben */
+       b := c*(t.c - 1);
+end;
diff --git a/ag/lewurm_06.3 b/ag/lewurm_06.3
new file mode 100644 (file)
index 0000000..2b44db2
--- /dev/null
@@ -0,0 +1,5 @@
+method f(b)
+       var t := 0;
+       /* identifier doppelt vorhanden */
+       var b := 0;
+end;
diff --git a/ag/lewurm_07.0 b/ag/lewurm_07.0
new file mode 100644 (file)
index 0000000..b6c4511
--- /dev/null
@@ -0,0 +1,16 @@
+method f (a b)
+       a := b - 1;     
+end;
+
+method g (a)
+       a := a - 1;
+end;
+
+method main ()
+       var x := 0;
+       /* vgl.:
+        * [Term ’.’] ident ’(’ { Expr ’,’ } [ Expr ] ’)’ /* Methodenaufruf */
+       f (x,x,);
+       g (x,);
+       g (x);
+end;
diff --git a/ag/lewurm_08.0 b/ag/lewurm_08.0
new file mode 100644 (file)
index 0000000..fc4bc42
--- /dev/null
@@ -0,0 +1,6 @@
+struct x y end;
+method f()
+       /* erlaubt, da 'x' als 'this.x' zu lesen ist */
+    var n := x;
+    return n;
+end;
diff --git a/ag/nax_00.0 b/ag/nax_00.0
new file mode 100644 (file)
index 0000000..62d4d11
--- /dev/null
@@ -0,0 +1,10 @@
+struct 
+    x y z
+end;
+
+method f(a b c)
+    /* sollte funktionieren (zugriff auf this.x) */
+    var n := x;
+    return n;
+end;
+
diff --git a/ag/nax_01.0 b/ag/nax_01.0
new file mode 100644 (file)
index 0000000..f579a41
--- /dev/null
@@ -0,0 +1,15 @@
+struct mystruct
+    field1
+    field2
+    field3
+end;
+method doit()
+    var a := 10000;
+    var b := 0x42;
+
+    return a - (b * 100);
+end;
+
+method tester(arg)
+    doit();
+end;
diff --git a/ag/nax_02.0 b/ag/nax_02.0
new file mode 100644 (file)
index 0000000..a335fe6
--- /dev/null
@@ -0,0 +1,8 @@
+method with_args2(arg1 arg2)
+    var a := 0;
+    doit();
+    another_stmt();
+    a;
+    something();
+    something_other(arg1,);
+end;
diff --git a/ag/nax_03.2 b/ag/nax_03.2
new file mode 100644 (file)
index 0000000..9a78b21
--- /dev/null
@@ -0,0 +1,2 @@
+struct mystruct
+end
diff --git a/ag/nax_04.0 b/ag/nax_04.0
new file mode 100644 (file)
index 0000000..67a0c34
--- /dev/null
@@ -0,0 +1,6 @@
+/* 
+    Hi,
+     this is a very long comment with some keywords which should be eaten 
+    struct struct
+    struct
+*/
diff --git a/ag/nax_05.2 b/ag/nax_05.2
new file mode 100644 (file)
index 0000000..fc6fb9e
--- /dev/null
@@ -0,0 +1,3 @@
+method testit()
+    var b := 10 - d * 20;       /* should raise an error, since '(' ')' are missing */
+end;
diff --git a/ag/nax_06.0 b/ag/nax_06.0
new file mode 100644 (file)
index 0000000..146d79a
--- /dev/null
@@ -0,0 +1,25 @@
+struct person
+    first_name
+    last_name
+end;
+
+method doit(person)
+    person.print_names(person.first_name, person.last_name,);
+end;
+
+method print_names(arg1 arg2)
+    if arg1 = arg2 then
+        this.print(arg1);
+        return 1;
+    end;
+    this.print(arg1);
+    this.print(arg2);
+    var a := 0;
+    a := (1 - 0x3).to_f();
+
+    if 1 then
+        print(a);
+    else
+        print(0); /* never reached */
+    end;
+end;
diff --git a/ag/nax_07.0 b/ag/nax_07.0
new file mode 100644 (file)
index 0000000..257a7a3
--- /dev/null
@@ -0,0 +1,21 @@
+struct 
+    dots per line should be allowed some other 
+end;
+
+method doit(a b)
+    while a < b do
+        var something := 0x42;
+        var many := 0x42;
+        var and := 0x42;
+        while a = b do
+            the_end();
+        end;
+        if something then
+            doit();
+        else if not something then end;
+        end;
+
+        many.dots.per.line.should.be.allowed := and.some.other.dots;
+
+    end;
+end;
diff --git a/ag/nax_08.0 b/ag/nax_08.0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ag/nax_09.3 b/ag/nax_09.3
new file mode 100644 (file)
index 0000000..f78e9ec
--- /dev/null
@@ -0,0 +1,7 @@
+method abc(arg1 arg2)
+    if arg1 = arg2 then
+        var a := 42;
+    end;
+    
+    var b := a - -1;
+end;
diff --git a/ag/nax_10.0 b/ag/nax_10.0
new file mode 100644 (file)
index 0000000..f187306
--- /dev/null
@@ -0,0 +1,10 @@
+method test_nested_ifs(arg1 arg2)
+    if arg1 = arg2 then
+        var a := 1;
+    end;
+
+    if not (arg1 = arg2) then
+        var a := 2;
+        var b := a - -1;
+    end;
+end;
diff --git a/ag/nax_11.0 b/ag/nax_11.0
new file mode 100644 (file)
index 0000000..96058a2
--- /dev/null
@@ -0,0 +1,9 @@
+method abc(arg1 arg2)
+    if arg1 = arg2 then
+        var a := 42;
+    end;
+    
+    var a := 3;
+    var b := a - -1;
+end;
+
diff --git a/ag/nax_12.3 b/ag/nax_12.3
new file mode 100644 (file)
index 0000000..4ee7a1b
--- /dev/null
@@ -0,0 +1,6 @@
+struct a b c end;
+method test(arg1 arg2)
+    arg1.a := 10;
+end;
+
+struct c d e end;
diff --git a/ag/nax_14.3 b/ag/nax_14.3
new file mode 100644 (file)
index 0000000..7174855
--- /dev/null
@@ -0,0 +1,3 @@
+method abc(arg1 arg2)
+    var arg2 := 10; /* detect duplicates and fail */
+end;
diff --git a/parser/kersm00.2 b/parser/kersm00.2
deleted file mode 100644 (file)
index ae832e6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-method TForm1.FindString()
-var hFile;
-
-struct
-    pIniData;
-    pData;
-end;
-
-  /* Initalize Data */
-  hMapping  := _INVALID_HANDLE_VALUE;
-  pIniData     := 0x13;
-
-  result := 1;
-
-
-      /* Search File in Workspace... */
-      filename := abc;
-      if FileExists(aSearchFile) then
-        filename := aSearchFile;
-      else
-        return;
-      end;
-
-      /* CreateFileHandle... */
-      this.hFile := 10 * pIniData;
-
-
-
-      if hFile < INVALID_HANDLE_VALUE then
-       return 0x2345;
-      
-      if hFile = INVALID_HANDLE_VALUE then
-       return 23456;
-
-
-      while not result or pIniData = 0x12 do
-
-       pIniData := pIniData - 1;
-      end;
-end;
\ No newline at end of file
diff --git a/parser/kersm_00.2 b/parser/kersm_00.2
new file mode 100644 (file)
index 0000000..ae832e6
--- /dev/null
@@ -0,0 +1,40 @@
+method TForm1.FindString()
+var hFile;
+
+struct
+    pIniData;
+    pData;
+end;
+
+  /* Initalize Data */
+  hMapping  := _INVALID_HANDLE_VALUE;
+  pIniData     := 0x13;
+
+  result := 1;
+
+
+      /* Search File in Workspace... */
+      filename := abc;
+      if FileExists(aSearchFile) then
+        filename := aSearchFile;
+      else
+        return;
+      end;
+
+      /* CreateFileHandle... */
+      this.hFile := 10 * pIniData;
+
+
+
+      if hFile < INVALID_HANDLE_VALUE then
+       return 0x2345;
+      
+      if hFile = INVALID_HANDLE_VALUE then
+       return 23456;
+
+
+      while not result or pIniData = 0x12 do
+
+       pIniData := pIniData - 1;
+      end;
+end;
\ No newline at end of file
diff --git a/parser/lewurm_04.0 b/parser/lewurm_04.0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/parser/lewurm_05.0 b/parser/lewurm_05.0
new file mode 100644 (file)
index 0000000..8ce5264
--- /dev/null
@@ -0,0 +1,2 @@
+/* oneliner :) */
+struct x end; method f (a b c d e) if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then d := c - 0x1 - x.u; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end;
diff --git a/parser/lewurm_06.2 b/parser/lewurm_06.2
new file mode 100644 (file)
index 0000000..c9b0aac
--- /dev/null
@@ -0,0 +1,2 @@
+/* oneliner :) */
+struct x end; method f (a b c d e) if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then d := c - 0x1 - x.u; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end;
diff --git a/parser/lewurm_07.0 b/parser/lewurm_07.0
new file mode 100644 (file)
index 0000000..888d43b
--- /dev/null
@@ -0,0 +1,2 @@
+/* oneliner :) */
+struct x end; method f (a b c d e) if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then if (a<b) then while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do while (a=c) do d := c - 0x1 - x.u; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end;
diff --git a/parser/lewurm_08.0 b/parser/lewurm_08.0
new file mode 100644 (file)
index 0000000..b6c4511
--- /dev/null
@@ -0,0 +1,16 @@
+method f (a b)
+       a := b - 1;     
+end;
+
+method g (a)
+       a := a - 1;
+end;
+
+method main ()
+       var x := 0;
+       /* vgl.:
+        * [Term ’.’] ident ’(’ { Expr ’,’ } [ Expr ] ’)’ /* Methodenaufruf */
+       f (x,x,);
+       g (x,);
+       g (x);
+end;
diff --git a/scanner/bayer_00.0 b/scanner/bayer_00.0
new file mode 100644 (file)
index 0000000..33d559b
--- /dev/null
@@ -0,0 +1,7 @@
+/* comment
+**
+//*
+/* /*  end of comment
+***/
+
+/* another comment */ /* and another one */
diff --git a/scanner/bayer_00.out b/scanner/bayer_00.out
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/scanner/kersm00.0 b/scanner/kersm00.0
deleted file mode 100644 (file)
index ae832e6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-method TForm1.FindString()
-var hFile;
-
-struct
-    pIniData;
-    pData;
-end;
-
-  /* Initalize Data */
-  hMapping  := _INVALID_HANDLE_VALUE;
-  pIniData     := 0x13;
-
-  result := 1;
-
-
-      /* Search File in Workspace... */
-      filename := abc;
-      if FileExists(aSearchFile) then
-        filename := aSearchFile;
-      else
-        return;
-      end;
-
-      /* CreateFileHandle... */
-      this.hFile := 10 * pIniData;
-
-
-
-      if hFile < INVALID_HANDLE_VALUE then
-       return 0x2345;
-      
-      if hFile = INVALID_HANDLE_VALUE then
-       return 23456;
-
-
-      while not result or pIniData = 0x12 do
-
-       pIniData := pIniData - 1;
-      end;
-end;
\ No newline at end of file
diff --git a/scanner/kersm00.out b/scanner/kersm00.out
deleted file mode 100644 (file)
index c233f3f..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-method
-ident TForm1
-.
-ident FindString
-(
-)
-var
-ident hFile
-;
-struct
-ident pIniData
-;
-ident pData
-;
-end
-;
-ident hMapping
-:=
-ident _INVALID_HANDLE_VALUE
-;
-ident pIniData
-:=
-num 13
-;
-ident result
-:=
-num 1
-;
-ident filename
-:=
-ident abc
-;
-if
-ident FileExists
-(
-ident aSearchFile
-)
-then
-ident filename
-:=
-ident aSearchFile
-;
-else
-return
-;
-end
-;
-this
-.
-ident hFile
-:=
-num a
-*
-ident pIniData
-;
-if
-ident hFile
-<
-ident INVALID_HANDLE_VALUE 
-then
-return 
-num 2345
-;
-if
-ident hFile
-=
-ident INVALID_HANDLE_VALUE 
-then
-return
-num 5ba0
-;
-while
-not
-ident result
-or
-ident pIniData
-=
-num 12
-do
-ident pIniData
-:= 
-ident pIniData
--
-num 1
-;
-end
-;
-end
-;
\ No newline at end of file
diff --git a/scanner/kersm_00.0 b/scanner/kersm_00.0
new file mode 100644 (file)
index 0000000..ae832e6
--- /dev/null
@@ -0,0 +1,40 @@
+method TForm1.FindString()
+var hFile;
+
+struct
+    pIniData;
+    pData;
+end;
+
+  /* Initalize Data */
+  hMapping  := _INVALID_HANDLE_VALUE;
+  pIniData     := 0x13;
+
+  result := 1;
+
+
+      /* Search File in Workspace... */
+      filename := abc;
+      if FileExists(aSearchFile) then
+        filename := aSearchFile;
+      else
+        return;
+      end;
+
+      /* CreateFileHandle... */
+      this.hFile := 10 * pIniData;
+
+
+
+      if hFile < INVALID_HANDLE_VALUE then
+       return 0x2345;
+      
+      if hFile = INVALID_HANDLE_VALUE then
+       return 23456;
+
+
+      while not result or pIniData = 0x12 do
+
+       pIniData := pIniData - 1;
+      end;
+end;
\ No newline at end of file
diff --git a/scanner/kersm_00.out b/scanner/kersm_00.out
new file mode 100644 (file)
index 0000000..c233f3f
--- /dev/null
@@ -0,0 +1,89 @@
+method
+ident TForm1
+.
+ident FindString
+(
+)
+var
+ident hFile
+;
+struct
+ident pIniData
+;
+ident pData
+;
+end
+;
+ident hMapping
+:=
+ident _INVALID_HANDLE_VALUE
+;
+ident pIniData
+:=
+num 13
+;
+ident result
+:=
+num 1
+;
+ident filename
+:=
+ident abc
+;
+if
+ident FileExists
+(
+ident aSearchFile
+)
+then
+ident filename
+:=
+ident aSearchFile
+;
+else
+return
+;
+end
+;
+this
+.
+ident hFile
+:=
+num a
+*
+ident pIniData
+;
+if
+ident hFile
+<
+ident INVALID_HANDLE_VALUE 
+then
+return 
+num 2345
+;
+if
+ident hFile
+=
+ident INVALID_HANDLE_VALUE 
+then
+return
+num 5ba0
+;
+while
+not
+ident result
+or
+ident pIniData
+=
+num 12
+do
+ident pIniData
+:= 
+ident pIniData
+-
+num 1
+;
+end
+;
+end
+;
\ No newline at end of file
diff --git a/scanner/kersm_01.1 b/scanner/kersm_01.1
new file mode 100644 (file)
index 0000000..027132d
--- /dev/null
@@ -0,0 +1,40 @@
+method TForm1.FindString()
+var hFile;
+
+struct
+    pIniData;
+    pData;
+end;
+
+  /* Initalize Data */
+  hMapping  := _INVALID_HANDLE_VALUE;
+  pIniData     := 0x13;
+
+  result := 1;
+
+
+      /* Search File in Workspace... */
+      filename := abc;
+      if FileExists(aSearchFile) then
+        filename := aSearchFile;
+      else
+        return;
+      end;
+
+      /* CreateFileHandle... */
+      this.hFile := 10 % pIniData;
+
+
+
+      if hFile < INVALID_HANDLE_VALUE then
+       return 0x2345;
+      
+      if hFile = INVALID_HANDLE_VALUE then
+       return 23456;
+
+
+      while not result or pIniData = 0x12 do
+
+       pIniData := pIniData + 1;
+      end;
+end;
\ No newline at end of file