/* Parse command line arguments for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
"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
};
trace_grammar,
trace_resource,
trace_sets,
+ trace_muscles,
trace_tools,
trace_m4,
trace_skeleton,
trace_time,
+ trace_ielr,
trace_all
};
that argmatch_valid be more readable. */
"none - no warnings",
"midrule-values - unset or unused midrule values",
- "yacc - incompatibilities with POSIX YACC",
+ "yacc - incompatibilities with POSIX Yacc",
"all - all of the above",
"error - warnings are errors",
0
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 LALR(1) and GLR parsers.\n\
+Generate a deterministic or GLR parser employing LALR(1), IELR(1), or\n\
+canonical LR(1) parser tables.\n\
\n\
"), stdout);
fputs (_("\
Warning categories include:\n\
`midrule-values' unset or unused midrule values\n\
- `yacc' incompatibilities with POSIX YACC\n\
+ `yacc' incompatibilities with POSIX Yacc\n\
`all' all the warnings\n\
`no-CATEGORY' turn off warnings in CATEGORY\n\
`none' turn off all the warnings\n\
/* Build a location for the current command line argument. */
static
location
-command_line_location()
+command_line_location (void)
{
location res;
/* "<command line>" is used in GCC's messages about -D. */
char* value = strchr (optarg, '=');
if (value)
*value++ = 0;
- else
- value = "";
- muscle_percent_define_insert (name, command_line_location (), value);
+ muscle_percent_define_insert (name, command_line_location (),
+ value ? value : "");
}
break;
current_file = grammar_file = uniqstr_new (argv[optind]);
MUSCLE_INSERT_C_STRING ("file_name", grammar_file);
}
+
+void
+tr (char *s, char from, char to)
+{
+ for (; *s; s++)
+ if (*s == from)
+ *s = to;
+}