[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Wrong state index used in Java's yy_reduce_print
From: |
Tim Landscheidt |
Subject: |
[PATCH] Wrong state index used in Java's yy_reduce_print |
Date: |
Sun, 08 Jan 2012 01:25:49 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi,
the debugging function yy_reduce_print in the Java parser
used a wrong index for the state resulting in a less mean-
ingful output. The attached patch fixes this.
Tim
>From e75104f018bb55e32335e16535a40c90af55a780 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <address@hidden>
Date: Sun, 8 Jan 2012 01:17:56 +0000
Subject: [PATCH] Fix wrong state index used in Java parser's `yy_reduce_print'.
---
data/lalr1.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/data/lalr1.java b/data/lalr1.java
index 9aa4b4f..14aa05d 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -848,7 +848,7 @@ m4_popdef([b4_at_dollar])])dnl
/* The symbols being reduced. */
for (int yyi = 0; yyi < yynrhs; yyi++)
yy_symbol_print (" $" + (yyi + 1) + " =",
- yystos_[yystack.stateAt(yyi + 1 - yynrhs)],
+ yystos_[yystack.stateAt(yynrhs - (yyi + 1))],
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
b4_rhs_location(yynrhs, yyi + 1)])[);
}
--
1.6.2.5
- [PATCH] Wrong state index used in Java's yy_reduce_print,
Tim Landscheidt <=