]> git.saurik.com Git - bison.git/commitdiff
* doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
authorJoel E. Denny <jdenny@ces.clemson.edu>
Wed, 17 Oct 2007 04:35:35 +0000 (04:35 +0000)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Wed, 17 Oct 2007 04:35:35 +0000 (04:35 +0000)
(Option Cross Key): Likewise.

* src/print-xml.c (print_core): Don't print a reduction's lookahead set
next to an item whose dot is not at the end of the RHS even if it
happens to be associated with the same rule.
* src/print.c (print_core): Likewise.
* tests/conflicts.at (Unresolved SR Conflicts): Update output.
(Resolved SR Conflicts): Update output.
* tests/regression.at (Extra lookahead sets in report): New test case.

ChangeLog
doc/bison.texinfo
src/print-xml.c
src/print.c
tests/conflicts.at
tests/regression.at

index f34db94c48fdaa6530cf4586b3ec50eba9954292..d175ccc6f2c51172d4c2230738eaf564554248c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-10-17  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
+       (Option Cross Key): Likewise.
+
+       * src/print-xml.c (print_core): Don't print a reduction's lookahead set
+       next to an item whose dot is not at the end of the RHS even if it
+       happens to be associated with the same rule.
+       * src/print.c (print_core): Likewise.
+       * tests/conflicts.at (Unresolved SR Conflicts): Update output.
+       (Resolved SR Conflicts): Update output.
+       * tests/regression.at (Extra lookahead sets in report): New test case.
+
 2007-10-11  Wojciech Polak  <polak@gnu.org>
 
        * src/print-xml.c (print_core): Remove item set
index dae36315f42129b6e5eb2d6229f081608d8db63f..4b49c8113370810f784ad85fe73423cd774b9aed 100644 (file)
@@ -7649,6 +7649,9 @@ Print the version number of Bison and exit.
 @item --print-localedir
 Print the name of the directory containing locale-dependent data.
 
+@item --print-datadir
+Print the name of the directory containing skeletons and XSLT.
+
 @item -y
 @itemx --yacc
 Act more like the traditional Yacc command.  This can cause
@@ -7810,6 +7813,7 @@ the corresponding short option.
 @item @option{--no-lines}                   @tab @option{-l}
 @item @option{--output=@var{outfile}}       @tab @option{-o @var{outfile}}
 @item @option{--print-localedir}            @tab
+@item @option{--print-datadir}              @tab
 @item @option{--token-table}                @tab @option{-k}
 @item @option{--verbose}                    @tab @option{-v}
 @item @option{--version}                    @tab @option{-V}
index d1535a33e8b006ce20f12ee0cffc40b4b5e0f1bc..cbe71a161c4ef8106ba814560a9ada2591a05f7f 100644 (file)
@@ -122,7 +122,8 @@ print_core (FILE *out, int level, state *s)
       sp = rules[r].rhs;
 
       /* Display the lookahead tokens?  */
-      if (report_flag & report_lookahead_tokens)
+      if (report_flag & report_lookahead_tokens
+          && item_number_is_rule_number (*sp1))
        {
          reductions *reds = s->reductions;
          int red = state_reduction_find (s, &rules[r]);
index 157b25c6b54238f699d5fd442fa45f14fd68b9bb..0359632c8c8f933e29ceed24225b90e1b83eb945 100644 (file)
@@ -110,7 +110,8 @@ print_core (FILE *out, state *s)
        fprintf (out, " %s", symbols[*sp]->tag);
 
       /* Display the lookahead tokens?  */
-      if (report_flag & report_lookahead_tokens)
+      if (report_flag & report_lookahead_tokens
+          && item_number_is_rule_number (*sp1))
        state_rule_lookahead_tokens_print (s, &rules[r], out);
 
       fputc ('\n', out);
index 5e7df4a465ba09181cc2ea37f9df0fa8393682ca..2db956ee67ac1244d0607829489f0adb4bfeaa4b 100644 (file)
@@ -212,7 +212,7 @@ state 4
 
 state 5
 
-    1 exp: exp . OP exp  [$end, OP]
+    1 exp: exp . OP exp
     1    | exp OP exp .  [$end, OP]
 
     OP  shift, and go to state 4
@@ -315,7 +315,7 @@ state 4
 
 state 5
 
-    1 exp: exp . OP exp  [$end, OP]
+    1 exp: exp . OP exp
     1    | exp OP exp .  [$end, OP]
 
     $default  reduce using rule 1 (exp)
index caf445e6b4dc1b03b73db02dad6753d8eeee74f1..e0ab69355d5d150b78b794dc1a676e5d3f5a76f4 100644 (file)
@@ -1140,3 +1140,43 @@ start: 'a' "A" 'b';
 AT_CHECK([bison -t -o input.c input.y])
 
 AT_CLEANUP
+
+
+
+## -------------------------------- ##
+## Extra lookahead sets in report.  ##
+## -------------------------------- ##
+
+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.
+
+AT_DATA([[input.y]],
+[[%%
+start: a | 'a' a 'a' ;
+a: 'a' ;
+]])
+
+AT_CHECK([[bison --report=all input.y]])
+AT_CHECK([[sed -n '/^state 1$/,/^state 2$/p' input.output]], [[0]],
+[[state 1
+
+    2 start: 'a' . a 'a'
+    3 a: . 'a'
+    3  | 'a' .  [$end]
+
+    'a'  shift, and go to state 4
+
+    $default  reduce using rule 3 (a)
+
+    a  go to state 5
+
+
+state 2
+]])
+
+AT_CLEANUP