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:
Akim Demaille
2001-08-06 09:22:33 +00:00
parent ce4d5ce009
commit 22c2cbc078
8 changed files with 74 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
/* Open and close files for bison,
Copyright 1984, 1986, 1989, 1992, 2000 Free Software Foundation, Inc.
Copyright 1984, 1986, 1989, 1992, 2000, 2001 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -34,6 +34,7 @@ struct obstack table_obstack;
struct obstack defines_obstack;
struct obstack guard_obstack;
struct obstack output_obstack;
struct obstack graph_obstack;
char *spec_outfile = NULL; /* for -o. */
char *spec_file_prefix = NULL; /* for -b. */
@@ -213,7 +214,7 @@ compute_exts_from_gf(const char *ext)
{
src_extension = tr(ext, 'y', 'c');
src_extension = tr(src_extension, 'Y', 'C');
}
}
if (!header_extension)
{
header_extension = tr(ext, 'y', 'h');
@@ -228,7 +229,7 @@ compute_exts_from_src(const char *ext)
if (!src_extension)
src_extension = xstrdup(ext);
if (!header_extension)
{
{
header_extension = tr(ext, 'c', 'h');
header_extension = tr(header_extension, 'C', 'H');
}