165 |
Pp = bitset_create (nrules + 1, BITSET_FIXED); |
Pp = bitset_create (nrules + 1, BITSET_FIXED); |
166 |
|
|
167 |
/* If the start symbol isn't useful, then nothing will be useful. */ |
/* If the start symbol isn't useful, then nothing will be useful. */ |
168 |
if (bitset_test (N, start_symbol - ntokens)) |
if (bitset_test (N, axiom->number - ntokens)) |
169 |
{ |
{ |
170 |
bitset_set (V, start_symbol); |
bitset_set (V, axiom->number); |
171 |
|
|
172 |
while (1) |
while (1) |
173 |
{ |
{ |
315 |
if (ISVAR (*rhsp)) |
if (ISVAR (*rhsp)) |
316 |
*rhsp = symbol_number_as_item_number (nontermmap[*rhsp]); |
*rhsp = symbol_number_as_item_number (nontermmap[*rhsp]); |
317 |
} |
} |
318 |
start_symbol = nontermmap[start_symbol]; |
axiom->number = nontermmap[axiom->number]; |
319 |
} |
} |
320 |
|
|
321 |
nsyms -= nuseless_nonterminals; |
nsyms -= nuseless_nonterminals; |
435 |
|
|
436 |
reduce_print (); |
reduce_print (); |
437 |
|
|
438 |
if (!bitset_test (N, start_symbol - ntokens)) |
if (!bitset_test (N, axiom->number - ntokens)) |
439 |
fatal (_("Start symbol %s does not derive any sentence"), |
fatal (_("Start symbol %s does not derive any sentence"), |
440 |
quotearg_style (escape_quoting_style, symbols[start_symbol]->tag)); |
quotearg_style (escape_quoting_style, symbols[axiom->number]->tag)); |
441 |
|
|
442 |
/* First reduce the nonterminals, as they renumber themselves in the |
/* First reduce the nonterminals, as they renumber themselves in the |
443 |
whole grammar. If you change the order, nonterms would be |
whole grammar. If you change the order, nonterms would be |