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

Diff of /bison/src/tables.c

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

revision 1.6 by akim, Wed Sep 4 10:18:15 2002 UTC revision 1.7 by akim, Sun Oct 13 18:50:40 2002 UTC
# Line 212  table_grow (size_t desired) Line 212  table_grow (size_t desired)
212    
213    table = XREALLOC (table, base_t, table_size);    table = XREALLOC (table, base_t, table_size);
214    check = XREALLOC (check, base_t, table_size);    check = XREALLOC (check, base_t, table_size);
215    if (glr_parser)    conflict_table = XREALLOC (conflict_table, unsigned int, table_size);
     conflict_table = XREALLOC (conflict_table, unsigned int, table_size);  
216    
217    for (/* Nothing. */; old_size < table_size; ++old_size)    for (/* Nothing. */; old_size < table_size; ++old_size)
218      {      {
# Line 470  token_actions (void) Line 469  token_actions (void)
469    symbol_number_t j;    symbol_number_t j;
470    rule_number_t r;    rule_number_t r;
471    
472    int nconflict = conflicts_total_count ();    int nconflict = glr_parser ? conflicts_total_count () : 0;
473    
474    yydefact = XCALLOC (rule_number_t, nstates);    yydefact = XCALLOC (rule_number_t, nstates);
475    
476    actrow = XCALLOC (action_t, ntokens);    actrow = XCALLOC (action_t, ntokens);
477    conflrow = XCALLOC (unsigned int, ntokens);    conflrow = XCALLOC (unsigned int, ntokens);
478    
479      conflict_list = XCALLOC (unsigned int, 1 + 2 * nconflict);
480      conflict_list_free = 2 * nconflict;
481      conflict_list_cnt = 1;
482    
483    /* Find the rules which are reduced.  */    /* Find the rules which are reduced.  */
484    if (!glr_parser)    if (!glr_parser)
485      for (r = 0; r < nrules; ++r)      for (r = 0; r < nrules; ++r)
486        rules[r].useful = FALSE;        rules[r].useful = FALSE;
487    
   if (glr_parser)  
     {  
       conflict_list = XCALLOC (unsigned int, 1 + 2 * nconflict);  
       conflict_list_free = 2 * nconflict;  
       conflict_list_cnt = 1;  
     }  
   else  
     conflict_list_free = conflict_list_cnt = 0;  
   
488    for (i = 0; i < nstates; ++i)    for (i = 0; i < nstates; ++i)
489      {      {
490        rule_t *default_rule = action_row (states[i]);        rule_t *default_rule = action_row (states[i]);
# Line 799  pack_table (void) Line 793  pack_table (void)
793    base = XCALLOC (base_t, nvectors);    base = XCALLOC (base_t, nvectors);
794    pos = XCALLOC (base_t, nentries);    pos = XCALLOC (base_t, nentries);
795    table = XCALLOC (base_t, table_size);    table = XCALLOC (base_t, table_size);
796    if (glr_parser)    conflict_table = XCALLOC (unsigned int, table_size);
     conflict_table = XCALLOC (unsigned int, table_size);  
797    check = XCALLOC (base_t, table_size);    check = XCALLOC (base_t, table_size);
798    
799    lowzero = 0;    lowzero = 0;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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