From: Joel E. Denny Date: Mon, 7 Mar 2011 03:27:28 +0000 (-0500) Subject: java: fix parser tracing bug. X-Git-Tag: v2.7.90~613 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/02803d55cd78f1fe9516f20efd3f094e35577ddf java: fix parser tracing bug. * NEWS (2.5): Document. * data/lalr1.java (YYParser::YYStack::print): Don't skip top element. (cherry picked from commit f0e2c228a085196742250b3f394bb5ed55ac4d7c) --- diff --git a/ChangeLog b/ChangeLog index c0f22b52..db5fb256 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-03-06 Joel E. Denny + + 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 java: finish fixing parser stack popping bug. diff --git a/NEWS b/NEWS index 144aae85..ed2b23f9 100644 --- a/NEWS +++ b/NEWS @@ -357,6 +357,8 @@ Bison News *** The top element of each of the value stack and location stack is now 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): ** Bison now obeys -Werror and --warnings=error for warnings about diff --git a/data/lalr1.java b/data/lalr1.java index 79c15f1f..7a0ace41 100644 --- a/data/lalr1.java +++ b/data/lalr1.java @@ -326,7 +326,7 @@ b4_lexer_if([[ { out.print ("Stack now"); - for (int i = 0; i < height; i++) + for (int i = 0; i <= height; i++) { out.print (' '); out.print (stateStack[i]);