mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
Rename lr.default_reductions to lr.default-reductions.
* NEWS (2.5): Here. * doc/bison.texinfo: Here. * src/lalr.c (initialize_LA): Here. * src/print.c (print_reductions): Here. * src/reader.c (reader): Here. * src/tables.c (action_row): Here. * tests/input.at (%define enum variables): Here. * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
|
Rename lr.default_reductions to lr.default-reductions.
|
||||||
|
* NEWS (2.5): Here.
|
||||||
|
* doc/bison.texinfo: Here.
|
||||||
|
* src/lalr.c (initialize_LA): Here.
|
||||||
|
* src/print.c (print_reductions): Here.
|
||||||
|
* src/reader.c (reader): Here.
|
||||||
|
* src/tables.c (action_row): Here.
|
||||||
|
* tests/input.at (%define enum variables): Here.
|
||||||
|
* tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
|
||||||
|
|
||||||
2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
|
2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
Pacify ./configure --enable-gcc-warnings.
|
Pacify ./configure --enable-gcc-warnings.
|
||||||
|
|||||||
4
NEWS
4
NEWS
@@ -25,8 +25,8 @@ Bison News
|
|||||||
%define lr.type "canonical LR"
|
%define lr.type "canonical LR"
|
||||||
|
|
||||||
The default reduction optimization in the parser tables can also be
|
The default reduction optimization in the parser tables can also be
|
||||||
adjusted using `%define lr.default_reductions'. See the documentation
|
adjusted using `%define lr.default-reductions'. See the documentation
|
||||||
for `%define lr.type' and `%define lr.default_reductions' in the
|
for `%define lr.type' and `%define lr.default-reductions' in the
|
||||||
section `Bison Declaration Summary' in the Bison manual for the
|
section `Bison Declaration Summary' in the Bison manual for the
|
||||||
details.
|
details.
|
||||||
|
|
||||||
|
|||||||
@@ -4903,9 +4903,9 @@ More user feedback will help to stabilize it.)
|
|||||||
@item Default Value: @code{"pull"}
|
@item Default Value: @code{"pull"}
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@item lr.default_reductions
|
@item lr.default-reductions
|
||||||
@cindex default reductions
|
@cindex default reductions
|
||||||
@findex %define lr.default_reductions
|
@findex %define lr.default-reductions
|
||||||
@cindex delayed syntax errors
|
@cindex delayed syntax errors
|
||||||
@cindex syntax errors delayed
|
@cindex syntax errors delayed
|
||||||
|
|
||||||
@@ -5080,7 +5080,7 @@ syntactically acceptable in that left context.
|
|||||||
Thus, the only difference in parsing behavior is that the canonical
|
Thus, the only difference in parsing behavior is that the canonical
|
||||||
@acronym{LR} parser can report a syntax error as soon as possible
|
@acronym{LR} parser can report a syntax error as soon as possible
|
||||||
without performing any unnecessary reductions.
|
without performing any unnecessary reductions.
|
||||||
@xref{Decl Summary,,lr.default_reductions}, for further details.
|
@xref{Decl Summary,,lr.default-reductions}, for further details.
|
||||||
Even when canonical @acronym{LR} behavior is ultimately desired,
|
Even when canonical @acronym{LR} behavior is ultimately desired,
|
||||||
@acronym{IELR}'s elimination of duplicate conflicts should still
|
@acronym{IELR}'s elimination of duplicate conflicts should still
|
||||||
facilitate the development of a grammar.
|
facilitate the development of a grammar.
|
||||||
@@ -10346,7 +10346,7 @@ committee document contributing to what became the Algol 60 report.
|
|||||||
|
|
||||||
@item Consistent State
|
@item Consistent State
|
||||||
A state containing only one possible action.
|
A state containing only one possible action.
|
||||||
@xref{Decl Summary,,lr.default_reductions}.
|
@xref{Decl Summary,,lr.default-reductions}.
|
||||||
|
|
||||||
@item Context-free grammars
|
@item Context-free grammars
|
||||||
Grammars specified as rules that can be applied regardless of context.
|
Grammars specified as rules that can be applied regardless of context.
|
||||||
@@ -10361,7 +10361,7 @@ contains no other action for the lookahead token.
|
|||||||
In permitted parser states, Bison declares the reduction with the
|
In permitted parser states, Bison declares the reduction with the
|
||||||
largest lookahead set to be the default reduction and removes that
|
largest lookahead set to be the default reduction and removes that
|
||||||
lookahead set.
|
lookahead set.
|
||||||
@xref{Decl Summary,,lr.default_reductions}.
|
@xref{Decl Summary,,lr.default-reductions}.
|
||||||
|
|
||||||
@item Dynamic allocation
|
@item Dynamic allocation
|
||||||
Allocation of memory that occurs during execution, rather than at
|
Allocation of memory that occurs during execution, rather than at
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ initialize_LA (void)
|
|||||||
bool default_reduction_only_for_accept;
|
bool default_reduction_only_for_accept;
|
||||||
{
|
{
|
||||||
char *default_reductions =
|
char *default_reductions =
|
||||||
muscle_percent_define_get ("lr.default_reductions");
|
muscle_percent_define_get ("lr.default-reductions");
|
||||||
default_reduction_only_for_accept =
|
default_reduction_only_for_accept =
|
||||||
0 == strcmp (default_reductions, "accepting");
|
0 == strcmp (default_reductions, "accepting");
|
||||||
free (default_reductions);
|
free (default_reductions);
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ print_reductions (FILE *out, state *s)
|
|||||||
if (default_reduction)
|
if (default_reduction)
|
||||||
{
|
{
|
||||||
char *default_reductions =
|
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, "all")
|
||||||
|| (0 == strcmp (default_reductions, "consistent")
|
|| (0 == strcmp (default_reductions, "consistent")
|
||||||
|
|||||||
@@ -561,9 +561,9 @@ reader (void)
|
|||||||
muscle_percent_define_default ("lr.type", "LALR");
|
muscle_percent_define_default ("lr.type", "LALR");
|
||||||
lr_type = muscle_percent_define_get ("lr.type");
|
lr_type = muscle_percent_define_get ("lr.type");
|
||||||
if (0 != strcmp (lr_type, "canonical LR"))
|
if (0 != strcmp (lr_type, "canonical LR"))
|
||||||
muscle_percent_define_default ("lr.default_reductions", "all");
|
muscle_percent_define_default ("lr.default-reductions", "all");
|
||||||
else
|
else
|
||||||
muscle_percent_define_default ("lr.default_reductions", "accepting");
|
muscle_percent_define_default ("lr.default-reductions", "accepting");
|
||||||
free (lr_type);
|
free (lr_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,7 +571,7 @@ reader (void)
|
|||||||
{
|
{
|
||||||
static char const * const values[] = {
|
static char const * const values[] = {
|
||||||
"lr.type", "LALR", "IELR", "canonical LR", NULL,
|
"lr.type", "LALR", "IELR", "canonical LR", NULL,
|
||||||
"lr.default_reductions", "all", "consistent", "accepting", NULL,
|
"lr.default-reductions", "all", "consistent", "accepting", NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
muscle_percent_define_check_values (values);
|
muscle_percent_define_check_values (values);
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ action_row (state *s)
|
|||||||
labeled as consistent. */
|
labeled as consistent. */
|
||||||
{
|
{
|
||||||
char *default_reductions =
|
char *default_reductions =
|
||||||
muscle_percent_define_get ("lr.default_reductions");
|
muscle_percent_define_get ("lr.default-reductions");
|
||||||
if (0 != strcmp (default_reductions, "all") && !s->consistent)
|
if (0 != strcmp (default_reductions, "all") && !s->consistent)
|
||||||
nodefault = true;
|
nodefault = true;
|
||||||
free (default_reductions);
|
free (default_reductions);
|
||||||
|
|||||||
@@ -938,12 +938,12 @@ AT_SETUP([[%define enum variables]])
|
|||||||
|
|
||||||
# Front-end.
|
# Front-end.
|
||||||
AT_DATA([[input.y]],
|
AT_DATA([[input.y]],
|
||||||
[[%define lr.default_reductions "bogus"
|
[[%define lr.default-reductions "bogus"
|
||||||
%%
|
%%
|
||||||
start: ;
|
start: ;
|
||||||
]])
|
]])
|
||||||
AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
||||||
[[input.y:1.9-29: invalid value for %define variable `lr.default_reductions': `bogus'
|
[[input.y:1.9-29: invalid value for %define variable `lr.default-reductions': `bogus'
|
||||||
input.y:1.9-29: accepted value: `all'
|
input.y:1.9-29: accepted value: `all'
|
||||||
input.y:1.9-29: accepted value: `consistent'
|
input.y:1.9-29: accepted value: `consistent'
|
||||||
input.y:1.9-29: accepted value: `accepting'
|
input.y:1.9-29: accepted value: `accepting'
|
||||||
|
|||||||
@@ -1443,28 +1443,28 @@ dnl PARSER-EXIT-VALUE, PARSER-STDOUT, PARSER-STDERR
|
|||||||
|
|
||||||
|
|
||||||
## ------------------------------- ##
|
## ------------------------------- ##
|
||||||
## %define lr.default_reductions. ##
|
## %define lr.default-reductions. ##
|
||||||
## ------------------------------- ##
|
## ------------------------------- ##
|
||||||
|
|
||||||
# AT_TEST_LR_DEFAULT_REDUCTIONS(GRAMMAR, INPUT, TABLES)
|
# AT_TEST_LR_DEFAULT_REDUCTIONS(GRAMMAR, INPUT, TABLES)
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
m4_define([AT_TEST_LR_DEFAULT_REDUCTIONS],
|
m4_define([AT_TEST_LR_DEFAULT_REDUCTIONS],
|
||||||
[
|
[
|
||||||
AT_TEST_TABLES_AND_PARSE([[no %define lr.default_reductions]],
|
AT_TEST_TABLES_AND_PARSE([[no %define lr.default-reductions]],
|
||||||
[[all]], [[]],
|
[[all]], [[]],
|
||||||
[[]],
|
[[]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default_reductions "all"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "all"]],
|
||||||
[[all]], [[]],
|
[[all]], [[]],
|
||||||
[[%define lr.default_reductions "all"]],
|
[[%define lr.default-reductions "all"]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default_reductions "consistent"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "consistent"]],
|
||||||
[[consistent]], [[]],
|
[[consistent]], [[]],
|
||||||
[[%define lr.default_reductions "consistent"]],
|
[[%define lr.default-reductions "consistent"]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default_reductions "accepting"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "accepting"]],
|
||||||
[[accepting]], [[]],
|
[[accepting]], [[]],
|
||||||
[[%define lr.default_reductions "accepting"]],
|
[[%define lr.default-reductions "accepting"]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user