#include "revision.h"
#include <argmatch.h>
+#include <configmake.h>
#include <error.h>
/* Hack to get <getopt.h> to declare getopt with a prototype. */
bool nondeterministic_parser = false;
bool glr_parser = false;
bool pure_parser = false;
+bool push_parser = false;
int report_flag = report_none;
int trace_flag = trace_none;
*
* The special value 0 resets the flags to 0.
*/
-static int
-flags_argmatch (const char *option,
+static void
+flags_argmatch (const char *option,
const char * const keys[], const int values[],
int *flags, char *args)
{
if (args)
{
args = strtok (args, ",");
- do
+ while (args)
{
int value = XARGMATCH (option, args, keys, values);
if (value == 0)
*flags = 0;
else
*flags |= value;
+ args = strtok (NULL, ",");
}
- while ((args = strtok (NULL, ",")));
}
else
*flags = ~0;
}
-/** Decode a set of sub arguments.
+/** Decode a set of sub arguments.
*
* \param FlagName the flag familly to update.
* \param args the effective sub arguments to decode.
/* 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",
+ "error - warnings are errors",
0
};
static const int warnings_types[] =
{
warnings_none,
- warnings_error,
warnings_yacc,
- warnings_all
+ warnings_all,
+ warnings_error
};
ARGMATCH_VERIFY (warnings_args, warnings_types);
program_name);
else
{
- /* Some efforts were made to ease the translators' task, please
- continue. */
+ printf (_("Usage: %s [OPTION]... FILE\n"), program_name);
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);
+Generate LALR(1) and GLR parsers.\n\
+\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);
+Mandatory arguments to long options are mandatory for short options too.\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\
- -y, --yacc emulate POSIX Yacc\n"), stdout);
- putc ('\n', stdout);
+ -y, --yacc emulate POSIX Yacc\n\
+\n\
+"), stdout);
fputs (_("\
Parser:\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\
+\n\
"), stdout);
- putc ('\n', stdout);
fputs (_("\
Output:\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\
+ -g, --graph also output a graph of the automaton\n\
+\n\
"), stdout);
- putc ('\n', stdout);
fputs (_("\
THINGS is a list of comma separated words that can include:\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);
+ printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
}
exit (status);
break;
case 'W':
- FLAGS_ARGMATCH (warnings, optarg);
+ if (optarg)
+ FLAGS_ARGMATCH (warnings, optarg);
+ else
+ warnings_flag |= warnings_all;
break;
case LOCATIONS_OPTION: