/[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.60 by akim, Mon Mar 4 13:56:41 2002 UTC revision 1.61 by akim, Mon Mar 4 13:58:05 2002 UTC
# Line 25  Line 25 
25    
26  #include "system.h"  #include "system.h"
27  #include "bitset.h"  #include "bitset.h"
28    #include "bitsetv.h"
29  #include "reader.h"  #include "reader.h"
30  #include "types.h"  #include "types.h"
31  #include "LR0.h"  #include "LR0.h"
# Line 40  Line 41 
41  state_t **states = NULL;  state_t **states = NULL;
42    
43  short *LAruleno = NULL;  short *LAruleno = NULL;
44  bitset *LA = NULL;  bitsetv LA = NULL;
45  size_t nLA;  size_t nLA;
46    
47  static int ngotos;  static int ngotos;
# Line 50  short *to_state = NULL; Line 51  short *to_state = NULL;
51    
52  /* And for the famous F variable, which name is so descriptive that a  /* And for the famous F variable, which name is so descriptive that a
53     comment is hardly needed.  <grin>.  */     comment is hardly needed.  <grin>.  */
54  static bitset *F = NULL;  static bitsetv F = NULL;
55    
56  static short **includes;  static short **includes;
57  static shorts **lookback;  static shorts **lookback;
# Line 139  initialize_LA (void) Line 140  initialize_LA (void)
140    if (!nLA)    if (!nLA)
141      nLA = 1;      nLA = 1;
142    
143    LA = XCALLOC (bitset, nLA);    LA = bitsetv_create (nLA, ntokens, BITSET_FIXED);
   for (i = 0; i < nLA; ++i)  
     LA[i] = bitset_create (ntokens, BITSET_FIXED);  
144    LAruleno = XCALLOC (short, nLA);    LAruleno = XCALLOC (short, nLA);
145    lookback = XCALLOC (shorts *, nLA);    lookback = XCALLOC (shorts *, nLA);
146    
# Line 253  initialize_F (void) Line 252  initialize_F (void)
252    
253    int i;    int i;
254    
255    F = XCALLOC (bitset, ngotos);    F = bitsetv_create (ngotos, ntokens, BITSET_FIXED);
   for (i = 0; i < ngotos; ++i)  
     F[i] = bitset_create (ntokens, BITSET_FIXED);  
256    
257    for (i = 0; i < ngotos; i++)    for (i = 0; i < ngotos; i++)
258      {      {
# Line 500  compute_lookaheads (void) Line 497  compute_lookaheads (void)
497      LIST_FREE (shorts, lookback[i]);      LIST_FREE (shorts, lookback[i]);
498    
499    XFREE (lookback);    XFREE (lookback);
500    for (i = 0; i < (unsigned) ngotos; ++i)    bitsetv_free (F);
     bitset_free (F[i]);  
   XFREE (F);  
501  }  }
502    
503    

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