summaryrefslogtreecommitdiff
path: root/data/lalr1.java
diff options
context:
space:
mode:
authorBernd Kiefer <kiefer@dfki.de>2011-02-19 19:24:07 -0500
committerJoel E. Denny <joeldenny@joeldenny.org>2011-02-19 19:46:54 -0500
commit8db68289d1162b763606fe5271a7529408224d38 (patch)
treee98078dfec4db0a297f7873eec45725cc9bc83ee /data/lalr1.java
parentf3103c5b4fddf1d8f1d57a990772069538ccc706 (diff)
downloadbison-8db68289d1162b763606fe5271a7529408224d38.tar.gz
java: fix location handling bug.
Reported at <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>. * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix reversed access to location stack. * THANKS (Bernd Kiefer): Add.
Diffstat (limited to 'data/lalr1.java')
-rw-r--r--data/lalr1.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/lalr1.java b/data/lalr1.java
index 1533e370..aad54a33 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -102,7 +102,7 @@ b4_token_enums(b4_tokens)
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);
}]])[