From 02803d55cd78f1fe9516f20efd3f094e35577ddf Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Sun, 6 Mar 2011 22:27:28 -0500 Subject: [PATCH] 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) --- ChangeLog | 7 +++++++ NEWS | 2 ++ data/lalr1.java | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) 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]); -- 2.45.2