21 |
#include "system.h" |
#include "system.h" |
22 |
#include "complain.h" |
#include "complain.h" |
23 |
#include "getargs.h" |
#include "getargs.h" |
24 |
|
#include "symtab.h" |
25 |
#include "files.h" |
#include "files.h" |
26 |
#include "gram.h" |
#include "gram.h" |
27 |
#include "state.h" |
#include "state.h" |
100 |
for (i = 0; i < ntokens; i++) |
for (i = 0; i < ntokens; i++) |
101 |
if (BITISSET (LA (lookahead), i) |
if (BITISSET (LA (lookahead), i) |
102 |
&& BITISSET (lookaheadset, i) |
&& BITISSET (lookaheadset, i) |
103 |
&& sprec[i]) |
&& symbols[i]->prec) |
104 |
{ |
{ |
105 |
/* Shift-reduce conflict occurs for token number i |
/* Shift-reduce conflict occurs for token number i |
106 |
and it has a precedence. |
and it has a precedence. |
107 |
The precedence of shifting is that of token i. */ |
The precedence of shifting is that of token i. */ |
108 |
if (sprec[i] < redprec) |
if (symbols[i]->prec < redprec) |
109 |
{ |
{ |
110 |
log_resolution (state, lookahead, i, _("reduce")); |
log_resolution (state, lookahead, i, _("reduce")); |
111 |
flush_shift (state, i); |
flush_shift (state, i); |
112 |
} |
} |
113 |
else if (sprec[i] > redprec) |
else if (symbols[i]->prec > redprec) |
114 |
{ |
{ |
115 |
log_resolution (state, lookahead, i, _("shift")); |
log_resolution (state, lookahead, i, _("shift")); |
116 |
flush_reduce (lookahead, i); |
flush_reduce (lookahead, i); |