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

Diff of /bison/src/LR0.c

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

revision 1.15 by akim, Tue Nov 7 16:28:46 2000 UTC revision 1.16 by akim, Thu Oct 4 14:55:20 2001 UTC
# Line 23  Line 23 
23     The entry point is generate_states.  */     The entry point is generate_states.  */
24    
25  #include "system.h"  #include "system.h"
 #include "xalloc.h"  
26  #include "gram.h"  #include "gram.h"
27  #include "state.h"  #include "state.h"
28  #include "complain.h"  #include "complain.h"
# Line 33  Line 32 
32    
33  int nstates;  int nstates;
34  int final_state;  int final_state;
35  core *first_state;  core *first_state = NULL;
36  shifts *first_shift;  shifts *first_shift = NULL;
37  reductions *first_reduction;  reductions *first_reduction = NULL;
38    
39  static core *this_state;  static core *this_state = NULL;
40  static core *last_state;  static core *last_state = NULL;
41  static shifts *last_shift;  static shifts *last_shift = NULL;
42  static reductions *last_reduction;  static reductions *last_reduction = NULL;
43    
44  static int nshifts;  static int nshifts;
45  static short *shift_symbol;  static short *shift_symbol = NULL;
46    
47  static short *redset;  static short *redset = NULL;
48  static short *shiftset;  static short *shiftset = NULL;
49    
50  static short **kernel_base;  static short **kernel_base = NULL;
51  static short **kernel_end;  static short **kernel_end = NULL;
52  static short *kernel_items;  static short *kernel_items = NULL;
53    
54  /* hash table for states, to recognize equivalent ones.  */  /* hash table for states, to recognize equivalent ones.  */
55    
56  #define STATE_TABLE_SIZE        1009  #define STATE_TABLE_SIZE        1009
57  static core **state_table;  static core **state_table = NULL;
58    
59    
60  static void  static void
61  allocate_itemsets (void)  allocate_itemsets (void)
62  {  {
63    short *itemp;    short *itemp = NULL;
64    int symbol;    int symbol;
65    int i;    int i;
66    int count;    int count;
67    short *symbol_count;    short *symbol_count = NULL;
68    
69    count = 0;    count = 0;
70    symbol_count = XCALLOC (short, nsyms);    symbol_count = XCALLOC (short, nsyms);
# Line 89  allocate_itemsets (void) Line 88  allocate_itemsets (void)
88       We allocate that much space for each symbol.  */       We allocate that much space for each symbol.  */
89    
90    kernel_base = XCALLOC (short *, nsyms);    kernel_base = XCALLOC (short *, nsyms);
91    kernel_items = XCALLOC (short, count);    if (count)
92        kernel_items = XCALLOC (short, count);
93    
94    count = 0;    count = 0;
95    for (i = 0; i < nsyms; i++)    for (i = 0; i < nsyms; i++)

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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