X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d2729d44ab05f89e96d199ad6b10e127c1cb0a38..d9efd181112c1232acff11f11b2a5c064e08cf7d:/src/reduce.c?ds=inline diff --git a/src/reduce.c b/src/reduce.c index 6d811252..a654f0c7 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* @@ -28,16 +29,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ * parser. */ -#include #include "system.h" +#include "getargs.h" #include "files.h" #include "gram.h" -#include "machine.h" #include "alloc.h" +#include "complain.h" extern char **tags; /* reader.c */ -extern int verboseflag; /* getargs.c */ static int statisticsflag; /* XXXXXXX */ extern int fixed_outfiles; @@ -62,21 +62,23 @@ static int nuseful_productions, nuseless_productions, nuseful_nonterminals, nuseless_nonterminals; -bool bits_equal PARAMS((BSet, BSet, int)); -int nbits PARAMS((unsigned)); -int bits_size PARAMS((BSet, int)); -void reduce_grammar PARAMS((void)); +extern void reduce_grammar PARAMS((void)); +static bool bits_equal PARAMS((BSet, BSet, int)); +static int nbits PARAMS((unsigned)); +static int bits_size PARAMS((BSet, int)); static void useless_nonterminals PARAMS((void)); static void inaccessable_symbols PARAMS((void)); static void reduce_grammar_tables PARAMS((void)); static void print_results PARAMS((void)); static void print_notices PARAMS((void)); -void dump_grammar PARAMS((void)); -extern void fatals PARAMS((char *, char *)); +#if 0 /* XXX currently unused. */ +static void dump_grammar PARAMS((void)); +#endif + -bool +static bool bits_equal (BSet L, BSet R, int n) { int i; @@ -88,7 +90,7 @@ bits_equal (BSet L, BSet R, int n) } -int +static int nbits (unsigned i) { int count = 0; @@ -101,7 +103,7 @@ nbits (unsigned i) } -int +static int bits_size (BSet S, int n) { int i, count = 0; @@ -137,16 +139,17 @@ reduce_grammar (void) print_notices(); if (!BITISSET(N, start_symbol - ntokens)) - fatals(_("Start symbol %s does not derive any sentence"), + fatal (_("Start symbol %s does not derive any sentence"), tags[start_symbol]); reduce_grammar_tables(); - /* if (verboseflag) { - fprintf(foutput, "REDUCED GRAMMAR\n\n"); - dump_grammar(); - } - */ - +#if 0 + if (verboseflag) + { + fprintf(foutput, "REDUCED GRAMMAR\n\n"); + dump_grammar(); + } +#endif /**/ statisticsflag = FALSE; /* someday getopts should handle this */ if (statisticsflag == TRUE) fprintf(stderr, @@ -528,7 +531,8 @@ print_results (void) fprintf(foutput, "\n\n"); } -void +#if 0 /* XXX currently unused. */ +static void dump_grammar (void) { int i; @@ -563,6 +567,7 @@ dump_grammar (void) } fprintf(foutput, "\n\n"); } +#endif static void