mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 16:23:04 +00:00
style: clarify the way state kernels (aka cores) are built
Use state_list_append in a more natural way. * src/lr0.c (generate_states): Here.
This commit is contained in:
12
src/lr0.c
12
src/lr0.c
@@ -392,10 +392,14 @@ generate_states (void)
|
|||||||
allocate_storage ();
|
allocate_storage ();
|
||||||
closure_new (nritems);
|
closure_new (nritems);
|
||||||
|
|
||||||
/* Create the initial state. The 0 at the lhs is the index of the
|
/* Create the initial state, whose accessing symbol (by convention)
|
||||||
item of this initial rule. */
|
is 0, aka $end. */
|
||||||
item_index initial_core = 0;
|
{
|
||||||
state_list_append (0, 1, &initial_core);
|
/* The items of its core. */
|
||||||
|
kernel_size[0] = 1;
|
||||||
|
kernel_base[0][0] = 0;
|
||||||
|
state_list_append (0, kernel_size[0], kernel_base[0]);
|
||||||
|
}
|
||||||
|
|
||||||
/* States are queued when they are created; process them all. */
|
/* States are queued when they are created; process them all. */
|
||||||
for (state_list *list = first_state; list; list = list->next)
|
for (state_list *list = first_state; list; list = list->next)
|
||||||
|
|||||||
Reference in New Issue
Block a user