mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
(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.
62 lines
1.9 KiB
C
62 lines
1.9 KiB
C
/* Concentrate all options use in bison,
|
|
Copyright 2001, 2002 Free Software Foundation, Inc.
|
|
|
|
This file is part of Bison, the GNU Compiler Compiler.
|
|
|
|
Bison is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
any later version.
|
|
|
|
Bison is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Bison; see the file COPYING. If not, write to
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#ifndef OPTIONS_H_
|
|
# define OPTIONS_H_
|
|
|
|
/* opt_access_t and struct option_table_struct need to be declare
|
|
here, for the parse_percent_token function in lex.c. */
|
|
|
|
/* Option accessibility. */
|
|
typedef enum opt_access_e
|
|
{
|
|
opt_cmd_line = 1,
|
|
opt_percent,
|
|
opt_both
|
|
} opt_access_t;
|
|
|
|
/* This is the general struct, which contains user's options from
|
|
command line or in grammar with percent flag. */
|
|
struct option_table_s
|
|
{
|
|
/* Set the accessibility. */
|
|
opt_access_t access;
|
|
/* This name is used for long option et percent directives. */
|
|
const char *name;
|
|
/* Use for command line. */
|
|
int has_arg;
|
|
/* An optional lvalue to be set. */
|
|
void *flag;
|
|
/* A retval action returns the code. */
|
|
int ret_val;
|
|
/* The short option value, frequently a letter. */
|
|
int val;
|
|
};
|
|
|
|
extern const char *shortopts;
|
|
|
|
/* Table which contain all options. */
|
|
extern const struct option_table_s option_table[];
|
|
|
|
/* Return a malloc'd list of the options for getopt_long. */
|
|
struct option *long_option_table_new PARAMS ((void));
|
|
|
|
#endif /* !OPTIONS_H_ */
|