/[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.87 by akim, Wed Jul 31 19:49:52 2002 UTC revision 1.88 by akim, Thu Aug 1 18:12:11 2002 UTC
# Line 52  typedef struct goto_list_s Line 52  typedef struct goto_list_s
52  } goto_list_t;  } goto_list_t;
53    
54    
55  rule_t **LArule = NULL;  /* LARULE is a vector which records the rules that need lookahead in
56  bitsetv LA = NULL;     various states.  The elements of LARULE that apply to state S are
57       those from LOOKAHEADS[S] through LOOKAHEADS[S+1]-1.
58    
59       If LR is the length of LArule, then a number from 0 to LR-1 can
60       specify both a rule and a state where the rule might be applied.
61       */
62    
63    static rule_t **LArule = NULL;
64    
65    /* LA is a LR by NTOKENS matrix of bits.  LA[l, i] is 1 if the rule
66       LArule[l] is applicable in the appropriate state when the next
67       token is symbol i.  If LA[l, i] and LA[l, j] are both 1 for i != j,
68       it is a conflict.  */
69    
70    static bitsetv LA = NULL;
71  size_t nLA;  size_t nLA;
72    
73    
# Line 460  lalr (void) Line 474  lalr (void)
474    if (trace_flag & trace_sets)    if (trace_flag & trace_sets)
475      lookaheads_print (stderr);      lookaheads_print (stderr);
476  }  }
477    
478    
479    void
480    lalr_free (void)
481    {
482      state_number_t s;
483      for (s = 0; s < nstates; ++s)
484        {
485          states[s]->lookaheads = NULL;
486          states[s]->lookaheads_rule = NULL;
487        }
488      bitsetv_free (LA);
489      free (LArule);
490    }

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

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