+ /* 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.",
+ "tools - m4 invocation",
+ "m4 - m4 traces",
+ "skeleton - skeleton postprocessing",
+ "time - time consumption",
+ "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_tools,
+ trace_m4,
+ trace_skeleton,
+ trace_time,
+ 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",
+ "error - warnings are errors",
+ "yacc - incompatibilities with POSIX YACC",
+ "all - all of the above",
+ 0
+};
+
+static const int warnings_types[] =
+{
+ warnings_none,
+ warnings_error,
+ warnings_yacc,
+ warnings_all
+};
+
+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
+ {
+ /* Some efforts were made to ease the translators' task, please
+ continue. */
+ fputs (_("\
+GNU bison generates LALR(1) and GLR parsers.\n"), stdout);
+ putc ('\n', stdout);
+
+ fprintf (stdout, _("\
+Usage: %s [OPTION]... FILE\n"), program_name);
+ putc ('\n', stdout);
+
+ fputs (_("\
+If a long option shows an argument as mandatory, then it is mandatory\n\
+for the equivalent short option also. Similarly for optional arguments.\n"),
+ stdout);
+ putc ('\n', stdout);
+
+ fputs (_("\
+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\
+ -y, --yacc emulate POSIX Yacc\n"), stdout);
+ putc ('\n', stdout);
+
+ fputs (_("\
+Parser:\n\
+ -S, --skeleton=FILE specify the skeleton to use\n\
+ -t, --debug instrument the parser for debugging\n\
+ --locations enable locations computation\n\
+ -p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\
+ -l, --no-lines don't generate `#line' directives\n\
+ -n, --no-parser generate the tables only\n\
+ -k, --token-table include a table of token names\n\
+"), stdout);
+ putc ('\n', stdout);
+
+ fputs (_("\
+Output:\n\
+ -d, --defines also produce a header file\n\
+ -r, --report=THINGS also produce details on the automaton\n\
+ -v, --verbose same as `--report=state'\n\
+ -b, --file-prefix=PREFIX specify a PREFIX for output files\n\
+ -o, --output=FILE leave output to FILE\n\
+ -g, --graph also produce a VCG description of the automaton\n\
+"), stdout);
+ putc ('\n', stdout);
+
+ fputs (_("\
+THINGS is a list of comma separated words that can include:\n\
+ `state' describe the states\n\
+ `itemset' complete the core item sets with their closure\n\
+ `lookahead' explicitly associate lookahead tokens to items\n\
+ `solved' describe shift/reduce conflicts solving\n\
+ `all' include all the above information\n\
+ `none' disable the report\n\
+"), stdout);
+ putc ('\n', stdout);
+
+ fputs (_("\
+Report bugs to <" PACKAGE_BUGREPORT ">.\n"), stdout);
+ }
+
+ exit (status);
+}
+
+
+/*------------------------------.
+| Display the version message. |
+`------------------------------*/
+
+static void
+version (void)
+{
+ /* Some efforts were made to ease the translators' task, please
+ continue. */
+ printf (_("bison (GNU Bison) %s"), VERSION);
+ putc ('\n', stdout);
+ printf ("%s", revision);
+ fputs (_("Written by Robert Corbett and Richard Stallman.\n"), stdout);
+ putc ('\n', stdout);
+
+ fprintf (stdout,
+ _("Copyright (C) %d Free Software Foundation, Inc.\n"), 2006);
+
+ fputs (_("\
+This is free software; see the source for copying conditions. There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"),
+ stdout);