Automaton VCG graph output.
authorAkim Demaille <akim@epita.fr>
Mon, 6 Aug 2001 09:22:33 +0000 (09:22 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 6 Aug 2001 09:22:33 +0000 (09:22 +0000)
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.

ChangeLog
src/Makefile.am
src/Makefile.in
src/files.c
src/files.h
src/getargs.c
src/getargs.h
src/print_graph.c

index 0bb065eacaf28e2de186925dbf2f4794db7806c6..c15f1c4055d33ca731619a55da6e1d45bc004e74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2001-08-06  Marc Autret   <autret_@epita.fr>
+
+       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.
+
 2001-08-06  Marc Autret   <autret_@epita.fr>
 
        * src/print_graph.c, src/print_graph.h (graph): New.
 2001-08-06  Marc Autret   <autret_@epita.fr>
 
        * src/print_graph.c, src/print_graph.h (graph): New.
index 30248f866cc4eeedda74a771bb2063f5365f679f..b757258ef6d0a1040f84d33864aaa555ba9b8b81 100644 (file)
@@ -14,7 +14,7 @@ bison_SOURCES = LR0.c closure.c complain.c conflicts.c        \
     derives.c  \
     files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \
     output.c   \
     derives.c  \
     files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \
     output.c   \
-    print.c reader.c reduce.c symtab.c warshall.c
+    print.c reader.c reduce.c symtab.c warshall.c vcg.c print_graph.c
 
 EXTRA_bison_SOURCES = vmsgetargs.c
 
 
 EXTRA_bison_SOURCES = vmsgetargs.c
 
@@ -22,7 +22,8 @@ noinst_HEADERS = LR0.h closure.h complain.h conflicts.h \
  derives.h \
  files.h getargs.h gram.h lalr.h lex.h nullable.h \
  output.h state.h      \
  derives.h \
  files.h getargs.h gram.h lalr.h lex.h nullable.h \
  output.h state.h      \
- print.h reader.h reduce.h symtab.h warshall.h system.h types.h
+ print.h reader.h reduce.h symtab.h warshall.h system.h types.h \
+ vcg.h vcg_defaults.h print_graph.h
 
 pkgdata_DATA = bison.simple bison.hairy
 
 
 pkgdata_DATA = bison.simple bison.hairy
 
index d2aca762489186245b4f0125808cfdb04b4160d4..f4e8b240a48d2e57ac87889c65ab5ba7d7ae3638 100644 (file)
@@ -103,12 +103,12 @@ LDADD = @INTLLIBS@ ../lib/libbison.a
 
 bin_PROGRAMS = bison
 
 
 bin_PROGRAMS = bison
 
-bison_SOURCES = LR0.c closure.c complain.c conflicts.c     derives.c       files.c getargs.c gram.c lalr.c lex.c main.c nullable.c     output.c            print.c reader.c reduce.c symtab.c warshall.c
+bison_SOURCES = LR0.c closure.c complain.c conflicts.c     derives.c       files.c getargs.c gram.c lalr.c lex.c main.c nullable.c     output.c            print.c reader.c reduce.c symtab.c warshall.c vcg.c print_graph.c
 
 
 EXTRA_bison_SOURCES = vmsgetargs.c
 
 
 
 EXTRA_bison_SOURCES = vmsgetargs.c
 
-noinst_HEADERS = LR0.h closure.h complain.h conflicts.h  derives.h  files.h getargs.h gram.h lalr.h lex.h nullable.h  output.h state.h  print.h reader.h reduce.h symtab.h warshall.h system.h types.h
+noinst_HEADERS = LR0.h closure.h complain.h conflicts.h  derives.h  files.h getargs.h gram.h lalr.h lex.h nullable.h  output.h state.h  print.h reader.h reduce.h symtab.h warshall.h system.h types.h  vcg.h vcg_defaults.h print_graph.h
 
 
 pkgdata_DATA = bison.simple bison.hairy
 
 
 pkgdata_DATA = bison.simple bison.hairy
@@ -126,7 +126,7 @@ ANSI2KNR = ../lib/ansi2knr
 bison_OBJECTS =  LR0$U.o closure$U.o complain$U.o conflicts$U.o \
 derives$U.o files$U.o getargs$U.o gram$U.o lalr$U.o lex$U.o main$U.o \
 nullable$U.o output$U.o print$U.o reader$U.o reduce$U.o symtab$U.o \
 bison_OBJECTS =  LR0$U.o closure$U.o complain$U.o conflicts$U.o \
 derives$U.o files$U.o getargs$U.o gram$U.o lalr$U.o lex$U.o main$U.o \
 nullable$U.o output$U.o print$U.o reader$U.o reduce$U.o symtab$U.o \
-warshall$U.o
+warshall$U.o vcg$U.o print_graph$U.o
 bison_LDADD = $(LDADD)
 bison_DEPENDENCIES =  ../lib/libbison.a
 bison_LDFLAGS = 
 bison_LDADD = $(LDADD)
 bison_DEPENDENCIES =  ../lib/libbison.a
 bison_LDFLAGS = 
@@ -148,8 +148,9 @@ GZIP_ENV = --best
 DEP_FILES =  .deps/LR0.P .deps/closure.P .deps/complain.P \
 .deps/conflicts.P .deps/derives.P .deps/files.P .deps/getargs.P \
 .deps/gram.P .deps/lalr.P .deps/lex.P .deps/main.P .deps/nullable.P \
 DEP_FILES =  .deps/LR0.P .deps/closure.P .deps/complain.P \
 .deps/conflicts.P .deps/derives.P .deps/files.P .deps/getargs.P \
 .deps/gram.P .deps/lalr.P .deps/lex.P .deps/main.P .deps/nullable.P \
-.deps/output.P .deps/print.P .deps/reader.P .deps/reduce.P \
-.deps/symtab.P .deps/vmsgetargs.P .deps/warshall.P
+.deps/output.P .deps/print.P .deps/print_graph.P .deps/reader.P \
+.deps/reduce.P .deps/symtab.P .deps/vcg.P .deps/vmsgetargs.P \
+.deps/warshall.P
 SOURCES = $(bison_SOURCES) $(EXTRA_bison_SOURCES)
 OBJECTS = $(bison_OBJECTS)
 
 SOURCES = $(bison_SOURCES) $(EXTRA_bison_SOURCES)
 OBJECTS = $(bison_OBJECTS)
 
@@ -255,6 +256,8 @@ output_.c: output.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/output.c; then echo $(srcdir)/output.c; else echo output.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > output_.c
 print_.c: print.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/print.c; then echo $(srcdir)/print.c; else echo print.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > print_.c
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/output.c; then echo $(srcdir)/output.c; else echo output.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > output_.c
 print_.c: print.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/print.c; then echo $(srcdir)/print.c; else echo print.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > print_.c
+print_graph_.c: print_graph.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/print_graph.c; then echo $(srcdir)/print_graph.c; else echo print_graph.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > print_graph_.c
 reader_.c: reader.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/reader.c; then echo $(srcdir)/reader.c; else echo reader.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > reader_.c
 reduce_.c: reduce.c $(ANSI2KNR)
 reader_.c: reader.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/reader.c; then echo $(srcdir)/reader.c; else echo reader.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > reader_.c
 reduce_.c: reduce.c $(ANSI2KNR)
@@ -269,14 +272,17 @@ strspn_.c: strspn.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
 symtab_.c: symtab.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/symtab.c; then echo $(srcdir)/symtab.c; else echo symtab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > symtab_.c
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
 symtab_.c: symtab.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/symtab.c; then echo $(srcdir)/symtab.c; else echo symtab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > symtab_.c
+vcg_.c: vcg.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vcg.c; then echo $(srcdir)/vcg.c; else echo vcg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > vcg_.c
 vmsgetargs_.c: vmsgetargs.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vmsgetargs.c; then echo $(srcdir)/vmsgetargs.c; else echo vmsgetargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > vmsgetargs_.c
 warshall_.c: warshall.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/warshall.c; then echo $(srcdir)/warshall.c; else echo warshall.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > warshall_.c
 LR0_.o alloca_.o closure_.o complain_.o conflicts_.o derives_.o \
 files_.o getargs_.o gram_.o lalr_.o lex_.o main_.o memchr_.o \
 vmsgetargs_.c: vmsgetargs.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vmsgetargs.c; then echo $(srcdir)/vmsgetargs.c; else echo vmsgetargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > vmsgetargs_.c
 warshall_.c: warshall.c $(ANSI2KNR)
        $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/warshall.c; then echo $(srcdir)/warshall.c; else echo warshall.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > warshall_.c
 LR0_.o alloca_.o closure_.o complain_.o conflicts_.o derives_.o \
 files_.o getargs_.o gram_.o lalr_.o lex_.o main_.o memchr_.o \
-nullable_.o output_.o print_.o reader_.o reduce_.o stpcpy_.o strndup_.o \
-strnlen_.o strspn_.o symtab_.o vmsgetargs_.o warshall_.o : $(ANSI2KNR)
+nullable_.o output_.o print_.o print_graph_.o reader_.o reduce_.o \
+stpcpy_.o strndup_.o strnlen_.o strspn_.o symtab_.o vcg_.o \
+vmsgetargs_.o warshall_.o : $(ANSI2KNR)
 
 install-pkgdataDATA: $(pkgdata_DATA)
        @$(NORMAL_INSTALL)
 
 install-pkgdataDATA: $(pkgdata_DATA)
        @$(NORMAL_INSTALL)
index 4946477db8d89d71fd1be154ac608025e6f65ff5..82b6491c519aa153048601ac7db30840320e7ea9 100644 (file)
@@ -1,5 +1,5 @@
 /* Open and close files for bison,
 /* 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.
 
 
    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 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. */
 
 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');
     {
       src_extension = tr(ext, 'y', 'c');
       src_extension = tr(src_extension, 'Y', 'C');
-    } 
+    }
   if (!header_extension)
     {
       header_extension = tr(ext, 'y', 'h');
   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)
   if (!src_extension)
     src_extension = xstrdup(ext);
   if (!header_extension)
-    {     
+    {
       header_extension = tr(ext, 'c', 'h');
       header_extension = tr(header_extension, 'C', 'H');
     }
       header_extension = tr(ext, 'c', 'h');
       header_extension = tr(header_extension, 'C', 'H');
     }
index 564af1c7ffced46b2f4f61cac247a401f995fe3f..3c1b2f064a79fe73f873394083520bfefedbc66a 100644 (file)
@@ -56,6 +56,8 @@ extern struct obstack guard_obstack;
 /* The verbose output. */
 extern struct obstack output_obstack;
 
 /* The verbose output. */
 extern struct obstack output_obstack;
 
+/* The VCG graph output. */
+extern struct obstack graph_obstack;
 
 extern char *infile;
 extern char *attrsfile;
 
 extern char *infile;
 extern char *attrsfile;
index 7595e7c517f23efa51a2637c4e5dbe1034bb016d..29b349a4be1d13823f62e26d444ba4636eb7d7ea 100644 (file)
@@ -34,11 +34,12 @@ int token_table_flag = 0;
 int verbose_flag = 0;
 int statistics_flag = 0;
 int yacc_flag = 0;     /* for -y */
 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 *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. */
 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'},
   {"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},
 
   /* Hidden. */
   {"statistics",       no_argument,    &statistics_flag, 1},
@@ -178,6 +180,10 @@ getargs (int argc, char *argv[])
        version (stdout);
        exit (0);
 
        version (stdout);
        exit (0);
 
+      case 'g':
+       graph_flag = 1;
+       break;
+
       case 'v':
        verbose_flag = 1;
        break;
       case 'v':
        verbose_flag = 1;
        break;
index a8ff4559ce337b49f8d00257254a17cb230007c3..f3c3760192db0617dedb475966546dffcf801e19 100644 (file)
@@ -34,6 +34,7 @@ extern int no_parser_flag;    /* for -n */
 extern int statistics_flag;
 extern int token_table_flag;           /* for -k */
 extern int verbose_flag;       /* for -v */
 extern int statistics_flag;
 extern int token_table_flag;           /* for -k */
 extern int verbose_flag;       /* for -v */
+extern int graph_flag;         /* for -g */
 extern int yacc_flag;                  /* for -y */
 
 void getargs PARAMS ((int argc, char *argv[]));
 extern int yacc_flag;                  /* for -y */
 
 void getargs PARAMS ((int argc, char *argv[]));
index 4430f00da8e1ee2bd20f507ea9564073e1e0a789..6cab7234a9c7bff2eb20da328f5647d7e0f7a485 100644 (file)
@@ -1,5 +1,5 @@
-/* Output a VCG description on generated parser, for bison,
-   Copyright 1984, 1986, 1989, 2000, 2001 Free Software Foundation, Inc.
+/* Output a VCG description on generated parser, for Bison,
+   Copyright 2001 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -45,13 +45,13 @@ print_core (int state)
   core *statep;
   short *sp;
   short *sp1;
   core *statep;
   short *sp;
   short *sp1;
-  
+
   statep = state_table[state];
   k = statep->nitems;
 
   if (k == 0)
     return;
   statep = state_table[state];
   k = statep->nitems;
 
   if (k == 0)
     return;
-  
+
   obstack_sgrow(&graph_obstack, "\t\tlabel:\t\"");
 
   for (i = 0; i < k; i++)
   obstack_sgrow(&graph_obstack, "\t\tlabel:\t\"");
 
   for (i = 0; i < k; i++)
@@ -64,16 +64,16 @@ print_core (int state)
       rule = -(*sp);
 
       obstack_fgrow1(&graph_obstack, _("%d: "), rule);
       rule = -(*sp);
 
       obstack_fgrow1(&graph_obstack, _("%d: "), rule);
-      obstack_fgrow1(&graph_obstack, " %s  ->  ", tags[rlhs[rule]]);  
+      obstack_fgrow1(&graph_obstack, " %s  ->  ", tags[rlhs[rule]]);
 
       for (sp = ritem + rrhs[rule]; sp < sp1; sp++)
        obstack_fgrow1(&graph_obstack, "%s ", tags[*sp]);
 
       obstack_1grow(&graph_obstack, '.');
 
       for (sp = ritem + rrhs[rule]; sp < sp1; sp++)
        obstack_fgrow1(&graph_obstack, "%s ", tags[*sp]);
 
       obstack_1grow(&graph_obstack, '.');
-  
+
       while (*sp > 0)
        obstack_fgrow1(&graph_obstack, " %s", tags[*sp++]);
       while (*sp > 0)
        obstack_fgrow1(&graph_obstack, " %s", tags[*sp++]);
-      
+
       obstack_sgrow(&graph_obstack, "\\n");
     }
   obstack_sgrow(&graph_obstack, "\"\n");
       obstack_sgrow(&graph_obstack, "\\n");
     }
   obstack_sgrow(&graph_obstack, "\"\n");
@@ -92,7 +92,7 @@ print_actions (int state, node_t *node)
   int rule;
   static char buff[10];
   edge_t edge;
   int rule;
   static char buff[10];
   edge_t edge;
-  
+
   shiftp = shift_table[state];
   redp = reduction_table[state];
   errp = err_table[state];
   shiftp = shift_table[state];
   redp = reduction_table[state];
   errp = err_table[state];
@@ -119,7 +119,7 @@ print_actions (int state, node_t *node)
 
          if (ISVAR (symbol))
            break;
 
          if (ISVAR (symbol))
            break;
-         
+
          {
            new_edge (&edge);
 
          {
            new_edge (&edge);
 
@@ -129,11 +129,11 @@ print_actions (int state, node_t *node)
            edge.sourcename = node->title;
            edge.targetname = buff;
            sprintf (edge.targetname, "%d", state1);
            edge.sourcename = node->title;
            edge.targetname = buff;
            sprintf (edge.targetname, "%d", state1);
-           edge.color = (symbol == 0) ? blue : red; 
+           edge.color = (symbol == 0) ? blue : red;
            edge.label = tags[symbol];
            edge.label = tags[symbol];
-           output_edge (&edge, &graph_obstack);    
+           output_edge (&edge, &graph_obstack);
            close_edge (&graph_obstack);
            close_edge (&graph_obstack);
-         }     
+         }
        }
     }
   else
        }
     }
   else
@@ -155,13 +155,13 @@ print_actions (int state, node_t *node)
          symbol = errp->errs[j];
        }
     }
          symbol = errp->errs[j];
        }
     }
-  
+
   if (consistent[state] && redp)
     {
       rule = redp->rules[0];
       symbol = rlhs[rule];
     }
   if (consistent[state] && redp)
     {
       rule = redp->rules[0];
       symbol = rlhs[rule];
     }
-  
+
   if (i < k)
     {
       for (; i < k; i++)
   if (i < k)
     {
       for (; i < k; i++)
@@ -188,19 +188,19 @@ static void
 print_state (int state)
 {
   static char name[10];
 print_state (int state)
 {
   static char name[10];
-  node_t node;  
+  node_t node;
 
   new_node (&node);
   open_node (&graph_obstack);
 
   new_node (&node);
   open_node (&graph_obstack);
-  
+
   sprintf(name, "%d", state);
   sprintf(name, "%d", state);
-  node.title = name;  
+  node.title = name;
   output_node (&node, &graph_obstack);
   output_node (&node, &graph_obstack);
-  
+
   print_core (state);   /* node label */
   print_core (state);   /* node label */
-  
+
   close_node (&graph_obstack);
   close_node (&graph_obstack);
-  
+
   print_actions (state, &node);        /* edges */
 }
 \f
   print_actions (state, &node);        /* edges */
 }
 \f
@@ -209,23 +209,23 @@ void
 print_graph (void)
 {
   int i;
 print_graph (void)
 {
   int i;
-  
+
   if (!graph_flag)
     return ;
   new_graph (&graph);
   if (!graph_flag)
     return ;
   new_graph (&graph);
-  
+
   /* graph.smanhattan_edges = yes;
      graph.manhattan_edges = yes; */
   /* graph.smanhattan_edges = yes;
      graph.manhattan_edges = yes; */
-  
+
   graph.display_edge_labels = yes;
   graph.layoutalgorithm = 0;
   graph.display_edge_labels = yes;
   graph.layoutalgorithm = 0;
-  
+
   graph.port_sharing = no;
   graph.finetuning = yes;
   graph.straight_phase = yes;
   graph.priority_phase = yes;
   graph.splines = yes;
   graph.port_sharing = no;
   graph.finetuning = yes;
   graph.straight_phase = yes;
   graph.priority_phase = yes;
   graph.splines = yes;
-  
+
   graph.crossing_weight = median;
 
   /* Output graph options. */
   graph.crossing_weight = median;
 
   /* Output graph options. */
@@ -239,4 +239,3 @@ print_graph (void)
   /* Close graph. */
   close_graph (&graph, &graph_obstack);
 }
   /* Close graph. */
   close_graph (&graph, &graph_obstack);
 }
-