X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b9278c7d174c1be5d7482343c5e433f428657ed0..0d40b36417759153678ed0ad125bc912884f602d:/src/print.c diff --git a/src/print.c b/src/print.c index 2eecae4c..6efcc891 100644 --- a/src/print.c +++ b/src/print.c @@ -1,6 +1,6 @@ /* Print information on generated parser, for bison, - Copyright (C) 1984, 1986, 1989, 2000-2005, 2007, 2009-2012 Free + Copyright (C) 1984, 1986, 1989, 2000-2005, 2007, 2009-2015 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -106,8 +106,11 @@ print_core (FILE *out, state *s) for (sp = rules[r].rhs; sp < sp1; sp++) fprintf (out, " %s", symbols[*sp]->tag); fputs (" .", out); - for (/* Nothing */; *sp >= 0; ++sp) - fprintf (out, " %s", symbols[*sp]->tag); + if (0 <= *rules[r].rhs) + for (/* Nothing */; 0 <= *sp; ++sp) + fprintf (out, " %s", symbols[*sp]->tag); + else + fprintf (out, " %%empty"); /* Display the lookahead tokens? */ if (report_flag & report_lookahead_tokens @@ -206,7 +209,7 @@ print_errs (FILE *out, state *s) /*-------------------------------------------------------------------------. -| Report a reduction of RULE on LOOKAHEAD_TOKEN (which can be `default'). | +| Report a reduction of RULE on LOOKAHEAD_TOKEN (which can be 'default'). | | If not ENABLED, the rule is masked by a shift or a reduce (S/R and | | R/R conflicts). | `-------------------------------------------------------------------------*/ @@ -340,6 +343,7 @@ print_reductions (FILE *out, state *s) || (STREQ (default_reductions, "consistent") && default_reduction_only) || (reds->num == 1 && reds->rules[0]->number == 0)); + (void) default_reduction_only; free (default_reductions); } } @@ -514,7 +518,7 @@ print_results (void) print_grammar (out); /* If the whole state item sets, not only the kernels, are wanted, - `closure' will be run, which needs memory allocation/deallocation. */ + 'closure' will be run, which needs memory allocation/deallocation. */ if (report_flag & report_itemsets) new_closure (nritems); /* Storage for print_reductions. */