$1([table], [b4_table],
[[YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
-number is the opposite. If zero, do what YYDEFACT says.
-If YYTABLE_NINF, syntax error.]])
+number is the opposite. If YYTABLE_NINF, syntax error.]])
$1([check], [b4_check])
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
])
-
-# b4_percent_define_copy_(SOURCE, DESTINATION, [|_loc|_syncline])
-# ---------------------------------------------------------------
-# Copy the value/loc/syncline from the variable SOURCE to the DESTINATION.
-# Ignore undefined values. "Use" the SOURCE so that there are no
-# complaints about unused variables.
-m4_define([b4_percent_define_copy_],
-[m4_ifdef([b4_percent_define$3(]$1[)],
- [m4_define([b4_percent_define$3(]$2[)],
- m4_defn([b4_percent_define$3(]$1[)]))])dnl
-])
-
-
-# b4_percent_define_copy(SOURCE, DESTINATION)
-# -------------------------------------------
-# Define the variable DESTINATION as a copy of SOURCE.
-m4_define([b4_percent_define_copy],
-[b4_percent_define_use([$1])dnl
-b4_percent_define_copy_([$1], [$2], [])dnl
-b4_percent_define_copy_([$1], [$2], [_loc])dnl
-b4_percent_define_copy_([$1], [$2], [_syncline])dnl
-])
-
-
# b4_percent_define_get(VARIABLE)
# -------------------------------
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
b4_percent_define_if_define_([$1], $[1], $[2])])
-# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
-# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
-# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT])
-# b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT])
-# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
-# ----------------------------------------------
-b4_percent_define_if_define([error-verbose])
-b4_percent_define_if_define([lex_symbol])
-b4_percent_define_if_define([locations]) # Whether locations are tracked.
-b4_percent_define_if_define([parse.assert])
-b4_percent_define_if_define([parse.trace])
-b4_percent_define_if_define([variant])
-
-
-
# b4_percent_define_check_values(VALUES)
# --------------------------------------
# Mimic muscle_percent_define_check_values in ../src/muscle_tab.h exactly
[$3])])
+## ------------------ ##
+## Common variables. ##
+## ------------------ ##
+
# Default values for %define.
# ---------------------------
# If the api.tokens.prefix, it is empty.
m4_percent_define_default([[api.tokens.prefix]], [[]])
+# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
+# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
+# b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT])
+# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
+# ----------------------------------------------
+b4_percent_define_if_define([lex_symbol])
+b4_percent_define_if_define([locations]) # Whether locations are tracked.
+b4_percent_define_if_define([parse.assert])
+b4_percent_define_if_define([parse.trace])
+b4_percent_define_if_define([variant])
+
+
+# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT])
+# ------------------------------------------------------
+# Map %define parse.error "(simple|verbose)" to b4_error_verbose_if and
+# b4_error_verbose_flag.
+b4_percent_define_default([[parse.error]], [[simple]])
+b4_percent_define_check_values([[[[parse.error]],
+ [[simple]], [[verbose]]]])
+m4_define([b4_error_verbose_flag],
+ [m4_case(b4_percent_define_get([[parse.error]]),
+ [simple], [[0]],
+ [verbose], [[1]])])
+b4_define_flag_if([error_verbose])
## ----------------------------------------------------------- ##