java: fix reduction traces.

* data/lalr1.java (yy_reduce_print): Fix state index.
	Reported by Tim Landscheidt.
This commit is contained in:
Akim Demaille
2012-01-15 14:23:15 +01:00
parent 78e365574e
commit 2d404819d0
2 changed files with 7 additions and 1 deletions

View File

@@ -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)])[);
}