* doc/bison.texinfo (Debugging): Split into...

(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
This commit is contained in:
Akim Demaille
2002-05-25 16:12:40 +00:00
parent 78df825093
commit ec3bc3961d
25 changed files with 735 additions and 304 deletions

View File

@@ -484,7 +484,7 @@ option_strcmp (const char *left, const char *right)
token_t
parse_percent_token (void)
{
const struct option_table_struct *tx = NULL;
const struct option_table_s *tx = NULL;
const char *arg = NULL;
/* Where the ARG was found in token_buffer. */
size_t arg_offset = 0;
@@ -578,15 +578,16 @@ parse_percent_token (void)
switch (tx->ret_val)
{
case tok_stropt:
assert (tx->set_flag);
assert (tx->flag);
if (arg)
{
char **flag = (char **) tx->flag;
/* Keep only the first assignment: command line options have
already been processed, and we want them to have
precedence. Side effect: if this %-option is used
several times, only the first is honored. Bah. */
if (!*((char **) (tx->set_flag)))
*((char **) (tx->set_flag)) = xstrdup (arg);
if (!*flag)
*flag = xstrdup (arg);
}
else
fatal (_("`%s' requires an argument"), token_buffer);
@@ -594,8 +595,8 @@ parse_percent_token (void)
break;
case tok_intopt:
assert (tx->set_flag);
*((int *) (tx->set_flag)) = 1;
assert (tx->flag);
*((int *) (tx->flag)) = 1;
return tok_noop;
break;