529 |
int k; |
int k; |
530 |
int m = 0; |
int m = 0; |
531 |
int n = 0; |
int n = 0; |
|
int count; |
|
532 |
int default_rule; |
int default_rule; |
533 |
int nreds; |
int nreds; |
|
int max; |
|
534 |
int rule; |
int rule; |
535 |
int shift_state; |
int shift_state; |
536 |
int symbol; |
int symbol; |
|
unsigned mask; |
|
|
unsigned *wordp; |
|
537 |
reductions *redp; |
reductions *redp; |
538 |
shifts *shiftp; |
shifts *shiftp; |
539 |
errs *errp; |
errs *errp; |
558 |
n = state_table[state + 1].lookaheads; |
n = state_table[state + 1].lookaheads; |
559 |
|
|
560 |
for (i = n - 1; i >= m; i--) |
for (i = n - 1; i >= m; i--) |
561 |
{ |
/* and find each token which the rule finds acceptable |
562 |
rule = -LAruleno[i]; |
to come next */ |
563 |
wordp = LA (i); |
for (j = 0; j < ntokens; j++) |
564 |
mask = 1; |
/* and record this rule as the rule to use if that |
565 |
|
token follows. */ |
566 |
/* and find each token which the rule finds acceptable |
if (BITISSET (LA (i), j)) |
567 |
to come next */ |
actrow[j] = -LAruleno[i]; |
|
for (j = 0; j < ntokens; j++) |
|
|
{ |
|
|
/* and record this rule as the rule to use if that |
|
|
token follows. */ |
|
|
if (mask & *wordp) |
|
|
actrow[j] = rule; |
|
|
|
|
|
mask <<= 1; |
|
|
if (mask == 0) |
|
|
{ |
|
|
mask = 1; |
|
|
wordp++; |
|
|
} |
|
|
} |
|
|
} |
|
568 |
} |
} |
569 |
} |
} |
570 |
|
|
572 |
them, record the shift as the thing to do. So shift is preferred |
them, record the shift as the thing to do. So shift is preferred |
573 |
to reduce. */ |
to reduce. */ |
574 |
shiftp = state_table[state].shift_table; |
shiftp = state_table[state].shift_table; |
|
|
|
575 |
for (i = 0; i < shiftp->nshifts; i++) |
for (i = 0; i < shiftp->nshifts; i++) |
576 |
{ |
{ |
577 |
shift_state = shiftp->shifts[i]; |
shift_state = shiftp->shifts[i]; |
615 |
default_rule = redp->rules[0]; |
default_rule = redp->rules[0]; |
616 |
else |
else |
617 |
{ |
{ |
618 |
max = 0; |
int max = 0; |
619 |
for (i = m; i < n; i++) |
for (i = m; i < n; i++) |
620 |
{ |
{ |
621 |
count = 0; |
int count = 0; |
622 |
rule = -LAruleno[i]; |
rule = -LAruleno[i]; |
623 |
|
|
624 |
for (j = 0; j < ntokens; j++) |
for (j = 0; j < ntokens; j++) |