mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 16:23:04 +00:00
Rename "default rule" to "default reduction".
This includes changing variable names in code, changing comments, and renaming %define lr.default_rules to %define lr.default_reductions. * NEWS (2.5): Update IELR documentation. * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT documentation. * data/glr.c, data/lalr1.java: Sync copyright dates. * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions and lr.type documentation. Make some other wording improvements. (Glossary): Adjust cross-references and Default Reduction definition. * src/lalr.c (state_lookahead_tokens_count): Adjust code. Remove a confusing comment pointed out by Akim Demaille. (initialize_LA): Adjust code. * src/print-xml.c (print_reductions): Adjust code. * src/print.c (print_reductions): Adjust code. * src/reader.c (reader): Adjust code. * src/tables.c (action_row): Adjust code. (token_actions): Adjust code. * src/tables.h: Adjust YYDEFACT documentation. * tests/input.at (%define lr.default_rules invalid values): Rename test group to... (%define lr.default_reductions invalid values): ... this, and update grammar file and expected output. * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to... (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* Print an xml on generated parser, for Bison,
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -244,7 +244,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
{
|
||||
transitions *trans = s->transitions;
|
||||
reductions *reds = s->reductions;
|
||||
rule *default_rule = NULL;
|
||||
rule *default_reduction = NULL;
|
||||
int report = false;
|
||||
int i, j;
|
||||
|
||||
@@ -254,7 +254,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
}
|
||||
|
||||
if (yydefact[s->number] != 0)
|
||||
default_rule = &rules[yydefact[s->number] - 1];
|
||||
default_reduction = &rules[yydefact[s->number] - 1];
|
||||
|
||||
bitset_zero (no_reduce_set);
|
||||
FOR_EACH_SHIFT (trans, i)
|
||||
@@ -263,7 +263,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
if (s->errs->symbols[i])
|
||||
bitset_set (no_reduce_set, s->errs->symbols[i]->number);
|
||||
|
||||
if (default_rule)
|
||||
if (default_reduction)
|
||||
report = true;
|
||||
|
||||
if (reds->lookahead_tokens)
|
||||
@@ -276,7 +276,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
{
|
||||
if (! count)
|
||||
{
|
||||
if (reds->rules[j] != default_rule)
|
||||
if (reds->rules[j] != default_reduction)
|
||||
report = true;
|
||||
count = true;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
{
|
||||
if (! count)
|
||||
{
|
||||
if (reds->rules[j] != default_rule)
|
||||
if (reds->rules[j] != default_reduction)
|
||||
print_reduction (out, level + 1, symbols[i]->tag,
|
||||
reds->rules[j], true);
|
||||
else
|
||||
@@ -318,7 +318,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
{
|
||||
if (defaulted)
|
||||
print_reduction (out, level + 1, symbols[i]->tag,
|
||||
default_rule, true);
|
||||
default_reduction, true);
|
||||
defaulted = false;
|
||||
print_reduction (out, level + 1, symbols[i]->tag,
|
||||
reds->rules[j], false);
|
||||
@@ -326,9 +326,9 @@ print_reductions (FILE *out, int level, state *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (default_rule)
|
||||
if (default_reduction)
|
||||
print_reduction (out, level + 1,
|
||||
"$default", default_rule, true);
|
||||
"$default", default_reduction, true);
|
||||
|
||||
xml_puts (out, level, "</reductions>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user