java: fix parser tracing bug.

* NEWS (2.5): Document.
* data/lalr1.java (YYParser::YYStack::print): Don't skip top
element.
(cherry picked from commit f0e2c228a0)
This commit is contained in:
Joel E. Denny
2011-03-06 22:27:28 -05:00
parent 1a33f4f608
commit 02803d55cd
3 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
2011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
java: fix parser tracing bug.
* NEWS (2.5): Document.
* data/lalr1.java (YYParser::YYStack::print): Don't skip top
element.
2011-03-06 Joel E. Denny <joeldenny@joeldenny.org> 2011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
java: finish fixing parser stack popping bug. java: finish fixing parser stack popping bug.

2
NEWS
View File

@@ -357,6 +357,8 @@ Bison News
*** The top element of each of the value stack and location stack is now *** The top element of each of the value stack and location stack is now
cleared when popped so that it can be garbage collected. cleared when popped so that it can be garbage collected.
*** Parser traces now print the top element of the stack.
* Changes in version 2.4.3 (2010-08-05): * Changes in version 2.4.3 (2010-08-05):
** Bison now obeys -Werror and --warnings=error for warnings about ** Bison now obeys -Werror and --warnings=error for warnings about

View File

@@ -326,7 +326,7 @@ b4_lexer_if([[
{ {
out.print ("Stack now"); out.print ("Stack now");
for (int i = 0; i < height; i++) for (int i = 0; i <= height; i++)
{ {
out.print (' '); out.print (' ');
out.print (stateStack[i]); out.print (stateStack[i]);