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

Diff of /bison/src/lalr.c

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

revision 1.66 by akim, Mon Apr 22 08:21:54 2002 UTC revision 1.67 by akim, Sun May 26 18:39:04 2002 UTC
# Line 217  set_goto_map (void) Line 217  set_goto_map (void)
217  `----------------------------------------------------------*/  `----------------------------------------------------------*/
218    
219  static int  static int
220  map_goto (int state, token_number_t symbol)  map_goto (int state, symbol_number_t symbol)
221  {  {
222    int high;    int high;
223    int low;    int low;
# Line 267  initialize_F (void) Line 267  initialize_F (void)
267    
268        for (; j < sp->nshifts; j++)        for (; j < sp->nshifts; j++)
269          {          {
270            token_number_t symbol = SHIFT_SYMBOL (sp, j);            symbol_number_t symbol = SHIFT_SYMBOL (sp, j);
271            if (nullable[symbol])            if (nullable[symbol])
272              edge[nedges++] = map_goto (stateno, symbol);              edge[nedges++] = map_goto (stateno, symbol);
273          }          }
# Line 408  build_relations (void) Line 408  build_relations (void)
408    for (i = 0; i < ngotos; i++)    for (i = 0; i < ngotos; i++)
409      {      {
410        int nedges = 0;        int nedges = 0;
411        token_number_t symbol1 = states[to_state[i]]->accessing_symbol;        symbol_number_t symbol1 = states[to_state[i]]->accessing_symbol;
412        short *rulep;        short *rulep;
413    
414        for (rulep = derives[symbol1]; *rulep > 0; rulep++)        for (rulep = derives[symbol1]; *rulep > 0; rulep++)
# Line 427  build_relations (void) Line 427  build_relations (void)
427                  {                  {
428                    state = states[sp->shifts[j]];                    state = states[sp->shifts[j]];
429                    if (state->accessing_symbol                    if (state->accessing_symbol
430                        == item_number_as_token_number (*rp))                        == item_number_as_symbol_number (*rp))
431                      break;                      break;
432                  }                  }
433    
# Line 446  build_relations (void) Line 446  build_relations (void)
446                /* JF added rp>=ritem &&   I hope to god its right! */                /* JF added rp>=ritem &&   I hope to god its right! */
447                if (rp >= ritem && ISVAR (*rp))                if (rp >= ritem && ISVAR (*rp))
448                  {                  {
449                    /* Downcasting from item_number_t to token_number_t. */                    /* Downcasting from item_number_t to symbol_number_t. */
450                    edge[nedges++] = map_goto (states1[--length],                    edge[nedges++] = map_goto (states1[--length],
451                                               item_number_as_token_number (*rp));                                               item_number_as_symbol_number (*rp));
452                    if (nullable[*rp])                    if (nullable[*rp])
453                      done = 0;                      done = 0;
454                  }                  }

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

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