projects
/
bison.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lalr1.cc: check (and fix) %initial-action exception safety
[bison.git]
/
src
/
print.c
diff --git
a/src/print.c
b/src/print.c
index 7fc577c4e88841e1f7f33ed2ba59ab547b16326a..cb227aa513081fec25d1665b423dd02f1bc63bc6 100644
(file)
--- a/
src/print.c
+++ b/
src/print.c
@@
-1,7
+1,7
@@
/* Print information on generated parser, for bison,
/* 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-2012 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This file is part of Bison, the GNU Compiler Compiler.
@@
-22,7
+22,6
@@
#include "system.h"
#include <bitset.h>
#include "system.h"
#include <bitset.h>
-#include <quotearg.h>
#include "LR0.h"
#include "closure.h"
#include "LR0.h"
#include "closure.h"
@@
-31,7
+30,7
@@
#include "getargs.h"
#include "gram.h"
#include "lalr.h"
#include "getargs.h"
#include "gram.h"
#include "lalr.h"
-#include "muscle
_
tab.h"
+#include "muscle
-
tab.h"
#include "print.h"
#include "reader.h"
#include "reduce.h"
#include "print.h"
#include "reader.h"
#include "reduce.h"
@@
-245,7
+244,7
@@
print_reductions (FILE *out, state *s)
rule *default_reduction = NULL;
size_t width = 0;
int i, j;
rule *default_reduction = NULL;
size_t width = 0;
int i, j;
- bool
non_default_action = fals
e;
+ bool
default_reduction_only = tru
e;
if (reds->num == 0)
return;
if (reds->num == 0)
return;
@@
-299,7
+298,7
@@
print_reductions (FILE *out, state *s)
bool defaulted = false;
bool count = bitset_test (no_reduce_set, i);
if (count)
bool defaulted = false;
bool count = bitset_test (no_reduce_set, i);
if (count)
-
non_default_action = tru
e;
+
default_reduction_only = fals
e;
for (j = 0; j < reds->num; ++j)
if (bitset_test (reds->lookahead_tokens[j], i))
for (j = 0; j < reds->num; ++j)
if (bitset_test (reds->lookahead_tokens[j], i))
@@
-308,7
+307,7
@@
print_reductions (FILE *out, state *s)
{
if (reds->rules[j] != default_reduction)
{
{
if (reds->rules[j] != default_reduction)
{
-
non_default_action = tru
e;
+
default_reduction_only = fals
e;
print_reduction (out, width,
symbols[i]->tag,
reds->rules[j], true);
print_reduction (out, width,
symbols[i]->tag,
reds->rules[j], true);
@@
-319,7
+318,7
@@
print_reductions (FILE *out, state *s)
}
else
{
}
else
{
-
non_default_action = tru
e;
+
default_reduction_only = fals
e;
if (defaulted)
print_reduction (out, width,
symbols[i]->tag,
if (defaulted)
print_reduction (out, width,
symbols[i]->tag,
@@
-335,11
+334,11
@@
print_reductions (FILE *out, state *s)
if (default_reduction)
{
char *default_reductions =
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);
print_reduction (out, width, _("$default"), default_reduction, true);
- aver (0 == strcmp (default_reductions, "
all
")
+ aver (0 == strcmp (default_reductions, "
most
")
|| (0 == strcmp (default_reductions, "consistent")
|| (0 == strcmp (default_reductions, "consistent")
- &&
!non_default_action
)
+ &&
default_reduction_only
)
|| (reds->num == 1 && reds->rules[0]->number == 0));
free (default_reductions);
}
|| (reds->num == 1 && reds->rules[0]->number == 0));
free (default_reductions);
}