Hi all,

i attach a patch that seems to fix an error concerning locations in
the java version of the lalr1 parser. I changed this in a generated
file to test it, and it now delivers always the right results when
using debugging output during parsing, in contrast to the wrong
locations i got with the 2.4.3 version.

The patch has been made against the git repository as of today.
Unfortunately, i was not able to get this version to run on my
system, and could not test the validity of the patch there.

I hope somebody can confirm the correctness, and the patch is helpful.

Best,
        Bernd Kiefer


--
----------------------------------------------------------------------
Bernd Kiefer     DFKI GmbH,  Stuhlsatzenhausweg,  D-66123 Saarbruecken
[email protected]   +49-681/85775-5301 (phone)   +49-681/85775-5338 (fax)
----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vor-
                    sitzender), Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
--- lalr1.java	2011-02-14 15:21:30.000000000 +0100
+++ lalr1-patched.java	2011-02-14 15:30:24.000000000 +0100
@@ -120,7 +120,7 @@
   private ]b4_location_type[ yylloc (YYStack rhs, int n)
   {
     if (n > 0)
-      return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
+      return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
     else
       return new ]b4_location_type[ (rhs.locationAt (0).end);
   }]])[

Reply via email to