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. */
/*
#include "files.h"
#include "gram.h"
#include "machine.h"
-#include "new.h"
+#include "alloc.h"
extern char **tags; /* reader.c */
extern int verboseflag; /* getargs.c */
static int statisticsflag; /* XXXXXXX */
+extern int fixed_outfiles;
#ifndef TRUE
#define TRUE (1)
nuseful_nonterminals, nuseless_nonterminals;
-static void useless_nonterminals();
-static void inaccessable_symbols();
-static void reduce_grammar_tables();
-static void print_results();
-static void print_notices();
-void dump_grammar();
+bool bits_equal PARAMS((BSet, BSet, int));
+int nbits PARAMS((unsigned));
+int bits_size PARAMS((BSet, int));
+void reduce_grammar PARAMS((void));
+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 ();
+extern void fatals PARAMS((char *, char *));
\f
bool
-bits_equal (L, R, n)
-BSet L;
-BSet R;
-int n;
+bits_equal (BSet L, BSet R, int n)
{
int i;
int
-nbits (i)
-unsigned i;
+nbits (unsigned i)
{
int count = 0;
while (i != 0) {
- i ^= (i & -i);
+ i ^= (i & ((unsigned) (- (int) i)));
++count;
}
return count;
int
-bits_size (S, n)
-BSet S;
-int n;
+bits_size (BSet S, int n)
{
int i, count = 0;
}
\f
void
-reduce_grammar ()
+reduce_grammar (void)
{
bool reduced;
\f
/*
* Another way to do this would be with a set for each production and then do
- * subset tests against N, but even for the C grammar the whole reducing
+ * subset tests against N0, but even for the C grammar the whole reducing
* process takes only 2 seconds on my 8Mhz AT.
*/
static bool
-useful_production (i, N)
-int i;
-BSet N;
+useful_production (int i, BSet N0)
{
rule r;
short n;
for (r = &ritem[rrhs[i]]; *r > 0; r++)
if (ISVAR(n = *r))
- if (!BITISSET(N, n - ntokens))
+ if (!BITISSET(N0, n - ntokens))
return FALSE;
return TRUE;
}
/* Remember that rules are 1-origin, symbols are 0-origin. */
static void
-useless_nonterminals ()
+useless_nonterminals (void)
{
BSet Np, Ns;
int i, n;
}
\f
static void
-inaccessable_symbols ()
+inaccessable_symbols (void)
{
BSet Vp, Vs, Pp;
int i, n;
}
\f
static void
-reduce_grammar_tables ()
+reduce_grammar_tables (void)
{
/* This is turned off because we would need to change the numbers
in the case statements in the actions file. */
}
\f
static void
-print_results ()
+print_results (void)
{
int i;
/* short j; JF unused */
}
\f
void
-dump_grammar ()
+dump_grammar (void)
{
int i;
rule r;
static void
-print_notices ()
+print_notices (void)
{
- extern int fixed_outfiles;
-
if (fixed_outfiles && nuseless_productions)
fprintf(stderr, _("%d rules never reduced\n"), nuseless_productions);