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 |
|
|
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 |
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; |
236 |
} |
} |
237 |
} |
} |
238 |
|
|
239 |
maxrhs = max; |
return max; |
240 |
} |
} |
241 |
|
|
242 |
|
|
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 |
{ |
{ |
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 (); |