29 |
#include "getargs.h" |
#include "getargs.h" |
30 |
#include "files.h" |
#include "files.h" |
31 |
#include "gram.h" |
#include "gram.h" |
|
#include "xalloc.h" |
|
32 |
#include "complain.h" |
#include "complain.h" |
33 |
#include "reduce.h" |
#include "reduce.h" |
34 |
#include "reader.h" |
#include "reader.h" |
116 |
useless_nonterminals (void) |
useless_nonterminals (void) |
117 |
{ |
{ |
118 |
BSet Np, Ns; |
BSet Np, Ns; |
119 |
int i, n; |
int i; |
120 |
|
|
121 |
/* N is set as built. Np is set being built this iteration. P is |
/* N is set as built. Np is set being built this iteration. P is |
122 |
set of all productions which have a RHS all in N. */ |
set of all productions which have a RHS all in N. */ |
139 |
saved to be used when finding useful productions: only |
saved to be used when finding useful productions: only |
140 |
productions in this set will appear in the final grammar. */ |
productions in this set will appear in the final grammar. */ |
141 |
|
|
|
n = 0; |
|
142 |
while (1) |
while (1) |
143 |
{ |
{ |
144 |
for (i = WORDSIZE (nvars) - 1; i >= 0; i--) |
for (i = WORDSIZE (nvars) - 1; i >= 0; i--) |
169 |
inaccessable_symbols (void) |
inaccessable_symbols (void) |
170 |
{ |
{ |
171 |
BSet Vp, Vs, Pp; |
BSet Vp, Vs, Pp; |
172 |
int i, n; |
int i; |
173 |
short t; |
short t; |
174 |
rule r; |
rule r; |
175 |
|
|
205 |
|
|
206 |
SETBIT (V, start_symbol); |
SETBIT (V, start_symbol); |
207 |
|
|
|
n = 0; |
|
208 |
while (1) |
while (1) |
209 |
{ |
{ |
210 |
for (i = WORDSIZE (nsyms) - 1; i >= 0; i--) |
for (i = WORDSIZE (nsyms) - 1; i >= 0; i--) |