+ARGMATCH_VERIFY (report_args, report_types);
+
+
+/*---------------------.
+| --trace's handling. |
+`---------------------*/
+
+static const char * const trace_args[] =
+{
+ /* In a series of synonyms, present the most meaningful first, so
+ that argmatch_valid be more readable. */
+ "none - no traces",
+ "scan - grammar scanner traces",
+ "parse - grammar parser traces",
+ "automaton - construction of the automaton",
+ "bitsets - use of bitsets",
+ "grammar - reading, reducing the grammar",
+ "resource - memory consumption (where available)",
+ "sets - grammar sets: firsts, nullable etc.",
+ "muscles - m4 definitions passed to the skeleton",
+ "tools - m4 invocation",
+ "m4 - m4 traces",
+ "skeleton - skeleton postprocessing",
+ "time - time consumption",
+ "ielr - IELR conversion",
+ "all - all of the above",
+ 0
+};
+
+static const int trace_types[] =
+{
+ trace_none,
+ trace_scan,
+ trace_parse,
+ trace_automaton,
+ trace_bitsets,
+ trace_grammar,
+ trace_resource,
+ trace_sets,
+ trace_muscles,
+ trace_tools,
+ trace_m4,
+ trace_skeleton,
+ trace_time,
+ trace_ielr,
+ trace_all
+};
+
+ARGMATCH_VERIFY (trace_args, trace_types);
+
+
+/*------------------------.
+| --warnings's handling. |
+`------------------------*/
+
+static const char * const warnings_args[] =
+{
+ /* In a series of synonyms, present the most meaningful first, so
+ that argmatch_valid be more readable. */
+ "none - no warnings",
+ "midrule-values - unset or unused midrule values",
+ "yacc - incompatibilities with POSIX Yacc",
+ "conflicts-sr - S/R conflicts",
+ "conflicts-rr - R/R conflicts",
+ "other - all other warnings",
+ "all - all of the above",
+ "error - warnings are errors",
+ 0
+};
+
+static const int warnings_types[] =
+{
+ warnings_none,
+ warnings_midrule_values,
+ warnings_yacc,
+ warnings_conflicts_sr,
+ warnings_conflicts_rr,
+ warnings_other,
+ warnings_all,
+ warnings_error
+};
+
+ARGMATCH_VERIFY (warnings_args, warnings_types);
+
+
+/*-------------------------------------------.
+| Display the help message and exit STATUS. |
+`-------------------------------------------*/
+
+static void usage (int) ATTRIBUTE_NORETURN;
+
+static void
+usage (int status)
+{
+ if (status != 0)
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
+ else
+ {
+ /* For ../build-aux/cross-options.pl to work, use the format:
+ ^ -S, --long[=ARGS] (whitespace)
+ A --long option is required.
+ Otherwise, add exceptions to ../build-aux/cross-options.pl. */
+
+ printf (_("Usage: %s [OPTION]... FILE\n"), program_name);
+ fputs (_("\
+Generate a deterministic LR or generalized LR (GLR) parser employing\n\
+LALR(1), IELR(1), or canonical LR(1) parser tables. IELR(1) and\n\
+canonical LR(1) support is experimental.\n\
+\n\
+"), stdout);
+
+ fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+ fputs (_("\
+The same is true for optional arguments.\n\
+"), stdout);
+
+ fputs (_("\
+\n\
+Operation modes:\n\
+ -h, --help display this help and exit\n\
+ -V, --version output version information and exit\n\
+ --print-localedir output directory containing locale-dependent data\n\
+ --print-datadir output directory containing skeletons and XSLT\n\
+ -y, --yacc emulate POSIX Yacc\n\
+ -W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\
+\n\
+"), stdout);
+
+ fputs (_("\
+Parser:\n\
+ -L, --language=LANGUAGE specify the output programming language\n\
+ (this is an experimental feature)\n\
+ -S, --skeleton=FILE specify the skeleton to use\n\
+ -t, --debug instrument the parser for tracing\n\
+ same as `-Dparse.trace'\n\
+ --locations enable location support\n\
+ -D, --define=NAME[=VALUE] similar to `%define NAME \"VALUE\"'\n\
+ -F, --force-define=NAME[=VALUE] override `%define NAME \"VALUE\"'\n\
+ -p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\
+ -l, --no-lines don't generate `#line' directives\n\
+ -k, --token-table include a table of token names\n\
+\n\
+"), stdout);
+
+ /* Keep -d and --defines separate so that ../build-aux/cross-options.pl
+ * won't assume that -d also takes an argument. */
+ fputs (_("\