]> git.saurik.com Git - bison.git/commitdiff
Initialize the muscle table before parsing the command line.
authorAkim Demaille <demaille@gostai.com>
Tue, 29 Jul 2008 10:47:41 +0000 (12:47 +0200)
committerAkim Demaille <demaille@gostai.com>
Fri, 7 Nov 2008 20:38:27 +0000 (21:38 +0100)
* src/getargs.c (quotearg.h, muscle_tab.h): Include.
(getargs): Define file_name.
* src/main.c (main): Initialize muscle_tab before calling
getargs.
* src/muscle_tab.c (muscle_init): No longer define file_name, as
its value is not available yet.

ChangeLog
src/getargs.c
src/main.c
src/muscle_tab.c

index bf6b6d8aa9cd089e68d6c9cb1ff7b10baf460989..89c35f58ec66d8b8ce37000bb4aee07645d79259 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-11-07  Akim Demaille  <demaille@gostai.com>
+
+       Initialize the muscle table before parsing the command line.
+       * src/getargs.c (quotearg.h, muscle_tab.h): Include.
+       (getargs): Define file_name.
+       * src/main.c (main): Initialize muscle_tab before calling
+       getargs.
+       * src/muscle_tab.c (muscle_init): No longer define file_name, as
+       its value is not available yet.
+
 2008-11-07  Akim Demaille  <demaille@gostai.com>
 
        Locations without columns for command line arguments.
 2008-11-07  Akim Demaille  <demaille@gostai.com>
 
        Locations without columns for command line arguments.
index 8af6528a1233cde704fb77c19a659a6b246a8fb0..cb90c362a86838db81cfd9c0ecf199284568afc1 100644 (file)
@@ -26,6 +26,7 @@
 #include <c-strcase.h>
 #include <configmake.h>
 #include <error.h>
 #include <c-strcase.h>
 #include <configmake.h>
 #include <error.h>
+#include <quotearg.h>
 
 /* Hack to get <getopt.h> to declare getopt with a prototype.  */
 #if lint && ! defined __GNU_LIBRARY__
 
 /* Hack to get <getopt.h> to declare getopt with a prototype.  */
 #if lint && ! defined __GNU_LIBRARY__
@@ -43,6 +44,7 @@
 #include "complain.h"
 #include "files.h"
 #include "getargs.h"
 #include "complain.h"
 #include "files.h"
 #include "getargs.h"
+#include "muscle_tab.h"
 #include "uniqstr.h"
 
 bool debug_flag;
 #include "uniqstr.h"
 
 bool debug_flag;
@@ -623,4 +625,5 @@ getargs (int argc, char *argv[])
     }
 
   current_file = grammar_file = uniqstr_new (argv[optind]);
     }
 
   current_file = grammar_file = uniqstr_new (argv[optind]);
+  MUSCLE_INSERT_C_STRING ("file_name", grammar_file);
 }
 }
index 9b472f1e9e538f7b2f780cccf30b61c4f62664ef..b3ef70ac733846afe4661409ea17ac5db48a89cb 100644 (file)
@@ -1,7 +1,7 @@
 /* Top level entry point of Bison.
 
    Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000, 2001, 2002, 2004,
 /* Top level entry point of Bison.
 
    Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000, 2001, 2002, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -62,6 +62,7 @@ main (int argc, char *argv[])
   (void) textdomain (PACKAGE);
 
   uniqstrs_new ();
   (void) textdomain (PACKAGE);
 
   uniqstrs_new ();
+  muscle_init ();
 
   getargs (argc, argv);
 
 
   getargs (argc, argv);
 
@@ -72,8 +73,6 @@ main (int argc, char *argv[])
   if (trace_flag & trace_bitsets)
     bitset_stats_enable ();
 
   if (trace_flag & trace_bitsets)
     bitset_stats_enable ();
 
-  muscle_init ();
-
   /* Read the input.  Copy some parts of it to FGUARD, FACTION, FTABLE
      and FATTRS.  In file reader.c.  The other parts are recorded in
      the grammar; see gram.h.  */
   /* Read the input.  Copy some parts of it to FGUARD, FACTION, FTABLE
      and FATTRS.  In file reader.c.  The other parts are recorded in
      the grammar; see gram.h.  */
index afe59becab0be10d0f144e2b3d0b61d2c6fda364..fe6affb66319cadf68294b8b0f3366cfcb16cfbe 100644 (file)
@@ -1,6 +1,6 @@
 /* Muscle table manager for Bison.
 
 /* Muscle table manager for Bison.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -85,7 +85,6 @@ muscle_init (void)
 
   /* Version and input file.  */
   MUSCLE_INSERT_STRING ("version", VERSION);
 
   /* Version and input file.  */
   MUSCLE_INSERT_STRING ("version", VERSION);
-  MUSCLE_INSERT_C_STRING ("file_name", grammar_file);
 }
 
 
 }