X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/110ef36a1a93c60cc83627492de40cb95aedf9b1..e141f4d4bb6584bfbf13003047a2e48e9a6eab6a:/src/print.c diff --git a/src/print.c b/src/print.c index 00e0149d..d66fc38d 100644 --- a/src/print.c +++ b/src/print.c @@ -1,7 +1,7 @@ /* Print information on generated parser, for bison, - Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1984, 1986, 1989, 2000-2005, 2007, 2009-2010 Free + Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -245,7 +245,7 @@ print_reductions (FILE *out, state *s) rule *default_reduction = NULL; size_t width = 0; int i, j; - bool non_default_action = false; + bool default_reduction_only = true; if (reds->num == 0) return; @@ -299,7 +299,7 @@ print_reductions (FILE *out, state *s) bool defaulted = false; bool count = bitset_test (no_reduce_set, i); if (count) - non_default_action = true; + default_reduction_only = false; for (j = 0; j < reds->num; ++j) if (bitset_test (reds->lookahead_tokens[j], i)) @@ -308,7 +308,7 @@ print_reductions (FILE *out, state *s) { if (reds->rules[j] != default_reduction) { - non_default_action = true; + default_reduction_only = false; print_reduction (out, width, symbols[i]->tag, reds->rules[j], true); @@ -319,7 +319,7 @@ print_reductions (FILE *out, state *s) } else { - non_default_action = true; + default_reduction_only = false; if (defaulted) print_reduction (out, width, symbols[i]->tag, @@ -335,11 +335,11 @@ print_reductions (FILE *out, state *s) if (default_reduction) { char *default_reductions = - muscle_percent_define_get ("lr.default_reductions"); + muscle_percent_define_get ("lr.default-reductions"); print_reduction (out, width, _("$default"), default_reduction, true); aver (0 == strcmp (default_reductions, "all") || (0 == strcmp (default_reductions, "consistent") - && !non_default_action) + && default_reduction_only) || (reds->num == 1 && reds->rules[0]->number == 0)); free (default_reductions); }