24 |
#include "files.h" |
#include "files.h" |
25 |
#include "complain.h" |
#include "complain.h" |
26 |
#include "getargs.h" |
#include "getargs.h" |
27 |
|
#include "xalloc.h" |
28 |
|
#include "options.h" |
29 |
|
|
30 |
int debug_flag = 0; |
int debug_flag = 0; |
31 |
int defines_flag = 0; |
int defines_flag = 0; |
41 |
const char *skeleton = NULL; |
const char *skeleton = NULL; |
42 |
|
|
43 |
extern char *program_name; |
extern char *program_name; |
|
const char *shortopts = "yvgdhrltknVo:b:p:S:"; |
|
|
static struct option longopts[] = |
|
|
{ |
|
|
/* Operation modes. */ |
|
|
{"help", no_argument, 0, 'h'}, |
|
|
{"version", no_argument, 0, 'V'}, |
|
|
{"yacc", no_argument, 0, 'y'}, |
|
|
{"fixed-output-files",no_argument, 0, 'y'}, |
|
|
|
|
|
/* Parser. */ |
|
|
{"skeleton", required_argument, 0, 'S'}, |
|
|
{"debug", no_argument, 0, 'd'}, |
|
|
{"locations", no_argument, &locations_flag, 1}, |
|
|
/* was 'a'; apparently unused -wjh */ |
|
|
{"name-prefix", required_argument, 0, 'p'}, |
|
|
{"no-lines", no_argument, 0, 'l'}, |
|
|
{"no-parser", no_argument, 0, 'n'}, |
|
|
{"raw", no_argument, 0, 'r'}, |
|
|
{"token-table", no_argument, 0, 'k'}, |
|
|
|
|
|
/* Output. */ |
|
|
{"defines", no_argument, 0, 'd'}, |
|
|
{"verbose", no_argument, 0, 'v'}, |
|
|
{"file-prefix", required_argument, 0, 'b'}, |
|
|
{"output-file", required_argument, 0, 'o'}, |
|
|
{"graph", no_argument, 0, 'g'}, |
|
|
|
|
|
/* Hidden. */ |
|
|
{"statistics", no_argument, &statistics_flag, 1}, |
|
|
{0, 0, 0, 0} |
|
|
}; |
|
44 |
|
|
45 |
/*---------------------------. |
/*---------------------------. |
46 |
| Display the help message. | |
| Display the help message. | |
132 |
{ |
{ |
133 |
int c; |
int c; |
134 |
|
|
135 |
|
create_long_option_table (); |
136 |
while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != EOF) |
while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != EOF) |
137 |
switch (c) |
switch (c) |
138 |
{ |
{ |
206 |
exit (1); |
exit (1); |
207 |
} |
} |
208 |
|
|
209 |
|
XFREE (longopts); |
210 |
if (optind == argc) |
if (optind == argc) |
211 |
{ |
{ |
212 |
fprintf (stderr, _("%s: no grammar file given\n"), program_name); |
fprintf (stderr, _("%s: no grammar file given\n"), program_name); |