remove empty-producing nonterminals
This commit is contained in:
@@ -253,6 +253,10 @@ generate(f) p_file f; {
|
||||
* of synchronisation with the action file
|
||||
*/
|
||||
while (p->n_count--) getaction(1);
|
||||
if (g_gettype(p->n_rule) == EORULE &&
|
||||
getntparams(p) == 0) {
|
||||
continue;
|
||||
}
|
||||
fprintf(fpars,"L%d_%s (\n",s->o_index,p->n_name);
|
||||
if (p->n_flags & PARAMS) {
|
||||
controlline();
|
||||
@@ -487,12 +491,6 @@ rulecode(p,safety,mustscan,mustpop) register p_gram p; {
|
||||
getntsafe(n) <= SAFESCANDONE)) {
|
||||
genpop(findindex(n->n_contains));
|
||||
}
|
||||
if (g_gettype(n->n_rule) == EORULE &&
|
||||
safety <= getntout(n) &&
|
||||
! g_getnpar(p)) {
|
||||
safety = getntout(n);
|
||||
break;
|
||||
}
|
||||
fprintf(f,"L%d_%s(\n",g_getcont(p), n->n_name);
|
||||
if (g_getnpar(p)) {
|
||||
controlline();
|
||||
|
||||
Reference in New Issue
Block a user