/[bison]/bison/src/conflicts.c
ViewVC logotype

Diff of /bison/src/conflicts.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.60 by akim, Thu Dec 27 18:10:48 2001 UTC revision 1.61 by akim, Sat Dec 29 14:18:32 2001 UTC
# Line 21  Line 21 
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"
# Line 99  resolve_sr_conflict (state_t *state, int Line 100  resolve_sr_conflict (state_t *state, int
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);

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26