/[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.16.2.8 by akim, Mon Nov 19 09:11:34 2001 UTC revision 1.16.2.9 by akim, Mon Nov 19 09:11:47 2001 UTC
# Line 1  Line 1 
1  /* Compute look-ahead criteria for bison,  /* Compute look-ahead criteria for bison,
2     Copyright 1984, 1986, 1989, 2000 Free Software Foundation, Inc.     Copyright 1984, 1986, 1989, 2000, 2001  Free Software Foundation, Inc.
3    
4     This file is part of Bison, the GNU Compiler Compiler.     This file is part of Bison, the GNU Compiler Compiler.
5    
# Line 48  short *to_state; Line 48  short *to_state;
48  extern void berror PARAMS ((const char *));  extern void berror PARAMS ((const char *));
49    
50  static int infinity;  static int infinity;
 static int maxrhs;  
51  static int ngotos;  static int ngotos;
52    
53  /* And for the famous F variable, which named is so descriptive that a  /* And for the famous F variable, which named is so descriptive that a
# Line 213  set_state_table (void) Line 212  set_state_table (void)
212  }  }
213    
214    
215  static void  /* Return the size of the longest ride hand side of the rules. */
216  set_maxrhs (void)  static size_t
217    maxrhs (void)
218  {  {
219    short *itemp;    short *itemp;
220    int length;    int length;
# Line 236  set_maxrhs (void) Line 236  set_maxrhs (void)
236          }          }
237      }      }
238    
239    maxrhs = max;    return max;
240  }  }
241    
242    
# Line 547  build_relations (void) Line 547  build_relations (void)
547    
548    includes = XCALLOC (short *, ngotos);    includes = XCALLOC (short *, ngotos);
549    edge = XCALLOC (short, ngotos + 1);    edge = XCALLOC (short, ngotos + 1);
550    states = XCALLOC (short, maxrhs + 1);    states = XCALLOC (short, maxrhs () + 1);
551    
552    for (i = 0; i < ngotos; i++)    for (i = 0; i < ngotos; i++)
553      {      {
# Line 673  lalr (void) Line 673  lalr (void)
673    tokensetsize = WORDSIZE (ntokens);    tokensetsize = WORDSIZE (ntokens);
674    
675    set_state_table ();    set_state_table ();
   set_maxrhs ();  
676    initialize_LA ();    initialize_LA ();
677    set_goto_map ();    set_goto_map ();
678    initialize_F ();    initialize_F ();

Legend:
Removed from v.1.16.2.8  
changed lines
  Added in v.1.16.2.9

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