From 75c21b618d2ee31e72f7b78b4a03d400514e433f Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 29 Jul 2008 12:47:41 +0200 Subject: [PATCH 1/1] 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. --- ChangeLog | 10 ++++++++++ src/getargs.c | 3 +++ src/main.c | 5 ++--- src/muscle_tab.c | 5 ++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18236ab7..f6d67157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-07 Akim Demaille + + 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-09 Akim Demaille Require the generation of parse-gram.output. diff --git a/src/getargs.c b/src/getargs.c index 35594cc8..56cee921 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Hack to get 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 "muscle_tab.h" #include "uniqstr.h" bool debug_flag; @@ -623,4 +625,5 @@ getargs (int argc, char *argv[]) } current_file = grammar_file = uniqstr_new (argv[optind]); + MUSCLE_INSERT_C_STRING ("file_name", grammar_file); } diff --git a/src/main.c b/src/main.c index 9b472f1e..b3ef70ac 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ /* 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. @@ -62,6 +62,7 @@ main (int argc, char *argv[]) (void) textdomain (PACKAGE); uniqstrs_new (); + muscle_init (); getargs (argc, argv); @@ -72,8 +73,6 @@ main (int argc, char *argv[]) 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. */ diff --git a/src/muscle_tab.c b/src/muscle_tab.c index 43415716..0265e45a 100644 --- a/src/muscle_tab.c +++ b/src/muscle_tab.c @@ -1,7 +1,7 @@ /* Muscle table manager for Bison. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software - Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free + Software 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); - MUSCLE_INSERT_C_STRING ("file_name", grammar_file); } -- 2.47.2