[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extra lookahead sets in report
From: |
Joel E. Denny |
Subject: |
Re: extra lookahead sets in report |
Date: |
Thu, 18 Oct 2007 22:46:29 -0400 (EDT) |
On Thu, 18 Oct 2007, Joel E. Denny wrote:
> On Thu, 18 Oct 2007, Akim Demaille wrote:
>
> > You don't need to, it's obvious. But what's not obvious is
> > what exactly is incorrect. Your comments seem to imply that
> > Bison is correct in its implementation of the "incorrect"
> > algorithm it uses, therefore, albeit incorrect, the result
> > is faithful. So I would just keep it, unless it's only
> > misleading.
>
> Is the following any clearer?
I committed the following, which I hope is even clearer. Let me know if
it still needs improvement.
Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1739
diff -p -u -r1.1739 ChangeLog
--- ChangeLog 17 Oct 2007 18:13:53 -0000 1.1739
+++ ChangeLog 19 Oct 2007 02:42:25 -0000
@@ -1,3 +1,11 @@
+2007-10-19 Joel E. Denny <address@hidden>
+
+ * NEWS: Add entry for recent .output file lookahead set fix.
+ * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
+ the example .output text.
+ * tests/regression.at (Extra lookahead sets in report): Improve wording
+ of comments.
+
2007-10-17 Wojciech Polak <address@hidden>
* src/print-xml.c (print_grammar): Renamed
Index: NEWS
===================================================================
RCS file: /sources/bison/bison/NEWS,v
retrieving revision 1.176
diff -p -u -r1.176 NEWS
--- NEWS 15 Aug 2007 20:21:19 -0000 1.176
+++ NEWS 19 Oct 2007 02:42:26 -0000
@@ -15,6 +15,15 @@ Changes in version 2.3a+ (????-??-??):
3. For any rule used only in such states, Bison now reports the rule as
"never reduced because of conflicts".
+* When instructed to generate a `.output' file including lookahead sets
+ (using `--report=lookahead', for example), Bison now prints each reduction's
+ lookahead set only next to the associated state's one item that (1) is
+ associated with the same rule as the reduction and (2) has its dot at the end
+ of its RHS. Previously, Bison also erroneously printed the lookahead set
+ next to all of the state's other items associated with the same rule. This
+ bug affected only the `.output' file and not the generated parser source
+ code.
+
* The -g and --graph options now output graphs in Graphviz DOT format,
not VCG format.
Index: doc/bison.texinfo
===================================================================
RCS file: /sources/bison/bison/doc/bison.texinfo,v
retrieving revision 1.239
diff -p -u -r1.239 bison.texinfo
--- doc/bison.texinfo 17 Oct 2007 04:35:34 -0000 1.239
+++ doc/bison.texinfo 19 Oct 2007 02:42:29 -0000
@@ -7387,7 +7387,7 @@ with some set of possible lookahead toke
@example
state 8
- exp -> exp . '+' exp [$, '+', '-', '/'] (rule 1)
+ exp -> exp . '+' exp (rule 1)
exp -> exp '+' exp . [$, '+', '-', '/'] (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
Index: tests/regression.at
===================================================================
RCS file: /sources/bison/bison/tests/regression.at,v
retrieving revision 1.115
diff -p -u -r1.115 regression.at
--- tests/regression.at 17 Oct 2007 04:35:35 -0000 1.115
+++ tests/regression.at 19 Oct 2007 02:42:30 -0000
@@ -1149,11 +1149,12 @@ AT_CLEANUP
AT_SETUP([[Extra lookahead sets in report]])
-# Within a single state, Bison used to print a reduction's lookahead set next
-# to all items of the associated rule. Instead, it should only print it next
-# to the item that is of the associated rule and whose dot is at the end of the
-# RHS. Printing it next to items whose dot is not at the end of the RHS is
-# sometimes redundant and, as in this test case, is sometimes incorrect.
+# Bison prints each reduction's lookahead set only next to the associated
+# state's one item that (1) is associated with the same rule as the reduction
+# and (2) has its dot at the end of its RHS. Previously, Bison also
+# erroneously printed the lookahead set next to all of the state's other items
+# associated with the same rule. This bug affected only the `.output' file and
+# not the generated parser source code.
AT_DATA([[input.y]],
[[%%