mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
Automaton VCG graph output.
Using option ``-g'' or long option ``--graph'', you can generate a gram_filename.vcg file containing a VCG description of the LALR (1) automaton of your grammar. * src/main.c: Call to print_graph() function. * src/getargs.h: Update. * src/getargs.c (options): Update to catch `-g' and `--graph' options. (graph_flag): New flag. (longopts): Update. (getargs): Add case `g'. * src/files.c (graph_obstack): New obstack struct. (open_files): Initialize new obstack. (output_files): Saves graph_obstack if required. * src/files.h (graph_obstack): New extern declaration. * src/Makefile.am: Add new source files.
This commit is contained in:
@@ -34,11 +34,12 @@ int token_table_flag = 0;
|
||||
int verbose_flag = 0;
|
||||
int statistics_flag = 0;
|
||||
int yacc_flag = 0; /* for -y */
|
||||
int graph_flag = 0;
|
||||
|
||||
const char *skeleton = NULL;
|
||||
|
||||
extern char *program_name;
|
||||
const char *shortopts = "yvdhrltknVo:b:p:S:";
|
||||
const char *shortopts = "yvgdhrltknVo:b:p:S:";
|
||||
static struct option longopts[] =
|
||||
{
|
||||
/* Operation modes. */
|
||||
@@ -63,6 +64,7 @@ static struct option longopts[] =
|
||||
{"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},
|
||||
@@ -178,6 +180,10 @@ getargs (int argc, char *argv[])
|
||||
version (stdout);
|
||||
exit (0);
|
||||
|
||||
case 'g':
|
||||
graph_flag = 1;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
verbose_flag = 1;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user