%define: accept unquoted values.

* NEWS (2.5): Group all %define changes together, and document
this one.  Remove quotes in IELR and canonical LR entry.
* doc/bison.texinfo: Remove quotes in most examples throughout.
(Decl Summary): Update %define documentation.
(Table of Symbols): Likewise.
* src/ielr.c (LrType): Update documentation.
* src/parse-gram.y (content.opt): Add production for ID.
* tests/calc.at: Likewise.
* tests/existing.at: Likewise.
* tests/input.at: Likewise.
* tests/local.at: Likewise.
* tests/push.at: Likewise.
* tests/reduce.at: Likewise.
* tests/torture.at: Likewise.
(cherry picked from commit cf499cff31)

Conflicts:

	doc/bison.texinfo
	src/parse-gram.c
	src/parse-gram.h
	tests/actions.at
	tests/calc.at
This commit is contained in:
Joel E. Denny
2009-08-28 03:46:37 -04:00
parent 3a414bbfa0
commit f37495f601
13 changed files with 225 additions and 178 deletions

View File

@@ -576,7 +576,7 @@ AT_CHECK_CALC_LALR([%yacc])
AT_CHECK_CALC_LALR([%error-verbose])
AT_CHECK_CALC_LALR([%define api.pure %locations])
AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %locations])
AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %locations])
AT_CHECK_CALC_LALR([%error-verbose %locations])
AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc])
@@ -585,7 +585,7 @@ AT_CHECK_CALC_LALR([%debug])
AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR([%define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR([%define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])

View File

@@ -42,18 +42,18 @@ AT_CHECK([[diff -u input-lalr.output input.output \
[[0]], [$1])])
AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
[[%define lr.type "lalr"
[[%define lr.type lalr
]$3],
[$4], [$5], [$6], [$7],
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]],
[[%define lr.type "ielr"
[[%define lr.type ielr
]$3],
[$4], [$5], [$6], [$7],
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]],
[[last-state,no-xml]],
[[%define lr.type "canonical-lr"
[[%define lr.type canonical-lr
]$3],
[$4], [$5], [$6], [$7],
[$9], [$10], [$11], [$12])

View File

@@ -1004,7 +1004,7 @@ AT_SETUP([[%define enum variables]])
# Front-end.
AT_DATA([[input.y]],
[[%define lr.default-reductions "bogus"
[[%define lr.default-reductions bogus
%%
start: ;
]])
@@ -1017,7 +1017,7 @@ input.y:1.9-29: accepted value: `accepting'
# Back-end.
AT_DATA([[input.y]],
[[%define api.push-pull "neither"
[[%define api.push-pull neither
%%
start: ;
]])
@@ -1052,7 +1052,7 @@ input.y:1.9-21: accepted value: `both'
]])
AT_DATA([[input.y]],
[[%define lr.keep_unreachable_states "maybe"
[[%define lr.keep_unreachable_states maybe
%%
start: ;
]])
@@ -1096,11 +1096,11 @@ AT_BISON_CHECK([[input.y]], [0], [],
])
AT_CHECK_API_PURE([[%language "c++" %defines]], [[]])
AT_CHECK_API_PURE([[%language "c++" %defines]], [["false"]])
AT_CHECK_API_PURE([[%language "c++" %defines]], [[false]])
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[""]])
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [["false"]])
AT_CHECK_API_PURE([[%language "java"]], [["true"]])
AT_CHECK_API_PURE([[%language "java"]], [["false"]])
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[false]])
AT_CHECK_API_PURE([[%language "java"]], [[true]])
AT_CHECK_API_PURE([[%language "java"]], [[false]])
AT_CLEANUP

View File

@@ -77,7 +77,7 @@ m4_pushdef([AT_LOCATION_IF],
[m4_bmatch([$3], [%locations], [$1], [$2])])
m4_pushdef([AT_PURE_IF],
[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
[m4_bmatch([$3], [%define *api\.pure *"false"], [$2], [$1])],
[m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])],
[$2])])
m4_pushdef([AT_PURE_AND_LOC_IF],
[m4_bmatch([$3], [%locations], [AT_PURE_IF($@)], [$2])])

View File

@@ -33,7 +33,7 @@ AT_DATA_GRAMMAR([[input.y]],
void yyerror (char const *msg);
%}
%define api.pure %define api.push-pull "push"
%define api.pure %define api.push-pull push
%%
@@ -93,7 +93,7 @@ AT_DATA_GRAMMAR([[input.y]],
int yylex (void);
%}
%define api.push-pull "]$1["
%define api.push-pull ]$1[
%%
@@ -156,7 +156,7 @@ AT_SETUP([[Push Parsing: Unsupported Skeletons]])
AT_DATA([[input.y]],
[[%glr-parser
%define api.push-pull "push"
%define api.push-pull push
%%
start: ;
]])

View File

@@ -375,19 +375,19 @@ m4_define([AT_TEST_LR_TYPE],
AT_TEST_TABLES_AND_PARSE([[no %define lr.type: ]$1],
[[LALR]], [[]],
[$2], m4_shiftn(2, $@))
AT_TEST_TABLES_AND_PARSE([[%define lr.type "lalr": ]$1],
AT_TEST_TABLES_AND_PARSE([[%define lr.type lalr: ]$1],
[[LALR]], [[]],
[[%define lr.type "lalr"
[[%define lr.type lalr
]$2],
m4_shiftn(2, $@))
AT_TEST_TABLES_AND_PARSE([[%define lr.type "ielr": ]$1],
AT_TEST_TABLES_AND_PARSE([[%define lr.type ielr: ]$1],
[[IELR]], [[]],
[[%define lr.type "ielr"
[[%define lr.type ielr
]$2],
m4_shiftn(2, $@))
AT_TEST_TABLES_AND_PARSE([[%define lr.type "canonical-lr": ]$1],
AT_TEST_TABLES_AND_PARSE([[%define lr.type canonical-lr: ]$1],
[[canonical LR]], [[]],
[[%define lr.type "canonical-lr"
[[%define lr.type canonical-lr
]$2],
m4_shiftn(2, $@))
])
@@ -1454,17 +1454,17 @@ AT_TEST_TABLES_AND_PARSE([[no %define lr.default-reductions]],
[[all]], [[]],
[[]],
[$1], [$2], [[]], [$3])
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "all"]],
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions all]],
[[all]], [[]],
[[%define lr.default-reductions "all"]],
[[%define lr.default-reductions all]],
[$1], [$2], [[]], [$3])
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "consistent"]],
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions consistent]],
[[consistent]], [[]],
[[%define lr.default-reductions "consistent"]],
[[%define lr.default-reductions consistent]],
[$1], [$2], [[]], [$3])
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "accepting"]],
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions accepting]],
[[accepting]], [[]],
[[%define lr.default-reductions "accepting"]],
[[%define lr.default-reductions accepting]],
[$1], [$2], [[]], [$3])
])

View File

@@ -496,7 +496,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore],
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
# push parsers.
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
[[%define api.push-pull "both"
[[%define api.push-pull both
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
@@ -534,7 +534,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
[[%define api.push-pull "both"
[[%define api.push-pull both
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])