%token WITHOUT_DASH "WITHOUT-DASH"
%token WITH.PERIOD
%token WITHOUT_PERIOD "WITHOUT.PERIOD"
+%code {
+ void yyerror (char const *);
+ int yylex (void);
+}
%%
start: with-dash without_dash with.period without_period;
with-dash: WITH-DASH;
# POSIX Yacc accept periods, but not dashes.
AT_BISON_CHECK([--yacc input.y], [1], [],
[[input.y:9.8-16: POSIX Yacc forbids dashes in symbol names: WITH-DASH
-input.y:14.8-16: POSIX Yacc forbids dashes in symbol names: with-dash
+input.y:18.8-16: POSIX Yacc forbids dashes in symbol names: with-dash
]])
# So warn about them.
AT_BISON_CHECK([-Wyacc input.y], [], [],
[[input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH
-input.y:14.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash
+input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash
]])
# Dashes are fine for GNU Bison.
AT_CLEANUP
-## ----------------------------------------- ##
-## %define lr.default_rules invalid values. ##
-## ----------------------------------------- ##
+## ------------------------ ##
+## %define enum variables. ##
+## ------------------------ ##
-AT_SETUP([[%define lr.default_rules invalid values]])
+AT_SETUP([[%define enum variables]])
+# Front-end.
AT_DATA([[input.y]],
-[[%define lr.default_rules "bogus"
+[[%define lr.default_reductions "bogus"
%%
start: ;
]])
-
AT_BISON_CHECK([[input.y]], [[1]], [[]],
-[[input.y:1.9-24: invalid value for %define variable `lr.default_rules': `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: `consistent'
+input.y:1.9-29: accepted value: `accepting'
]])
-AT_CLEANUP
-
-## ------------------------ ##
-## %define enum variables. ##
-## ------------------------ ##
-
-AT_SETUP([[%define enum variables]])
-
+# Back-end.
AT_DATA([[input.y]],
[[%define api.push_pull "neither"
%%
start: ;
]])
-
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-21: invalid value for %define variable `api.push_pull': `neither'
+input.y:1.9-21: accepted value: `pull'
+input.y:1.9-21: accepted value: `push'
+input.y:1.9-21: accepted value: `both'
]])
AT_CLEANUP