117 |
useless_nonterminals (void) |
useless_nonterminals (void) |
118 |
{ |
{ |
119 |
BSet Np, Ns; |
BSet Np, Ns; |
120 |
int i, n; |
int i; |
121 |
|
|
122 |
/* 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 |
123 |
set of all productions which have a RHS all in N. */ |
set of all productions which have a RHS all in N. */ |
140 |
saved to be used when finding useful productions: only |
saved to be used when finding useful productions: only |
141 |
productions in this set will appear in the final grammar. */ |
productions in this set will appear in the final grammar. */ |
142 |
|
|
|
n = 0; |
|
143 |
while (1) |
while (1) |
144 |
{ |
{ |
145 |
for (i = WORDSIZE (nvars) - 1; i >= 0; i--) |
for (i = WORDSIZE (nvars) - 1; i >= 0; i--) |
170 |
inaccessable_symbols (void) |
inaccessable_symbols (void) |
171 |
{ |
{ |
172 |
BSet Vp, Vs, Pp; |
BSet Vp, Vs, Pp; |
173 |
int i, n; |
int i; |
174 |
short t; |
short t; |
175 |
rule r; |
rule r; |
176 |
|
|
206 |
|
|
207 |
SETBIT (V, start_symbol); |
SETBIT (V, start_symbol); |
208 |
|
|
|
n = 0; |
|
209 |
while (1) |
while (1) |
210 |
{ |
{ |
211 |
for (i = WORDSIZE (nsyms) - 1; i >= 0; i--) |
for (i = WORDSIZE (nsyms) - 1; i >= 0; i--) |