mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
cex: style changes
* src/counterexample.c: Simplify a bit. * src/parse-simulation.c, src/parse-simulation.h: Enforce coding style.
This commit is contained in:
@@ -190,7 +190,7 @@ expand_to_conflict (state_item_number start, symbol_number conflict_sym)
|
|||||||
{
|
{
|
||||||
node = (si_bfs_node *) gl_list_get_at (queue, 0);
|
node = (si_bfs_node *) gl_list_get_at (queue, 0);
|
||||||
state_item *silast = state_items + node->si;
|
state_item *silast = state_items + node->si;
|
||||||
symbol_number sym = item_number_as_symbol_number (*(silast->item));
|
symbol_number sym = item_number_as_symbol_number (*silast->item);
|
||||||
if (sym == conflict_sym)
|
if (sym == conflict_sym)
|
||||||
break;
|
break;
|
||||||
if (ISVAR (sym))
|
if (ISVAR (sym))
|
||||||
@@ -893,10 +893,10 @@ static bool
|
|||||||
has_common_prefix (const item_number *itm1, const item_number *itm2)
|
has_common_prefix (const item_number *itm1, const item_number *itm2)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; !item_number_is_rule_number (*(itm1 + i)); ++i)
|
for (; !item_number_is_rule_number (itm1[i]); ++i)
|
||||||
if (*(itm1 + i) != *(itm2 + i))
|
if (itm1[i] != itm2[i])
|
||||||
return false;
|
return false;
|
||||||
return item_number_is_rule_number (*(itm2 + i));
|
return item_number_is_rule_number (itm2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ parse_state_derivation_completed (const parse_state *ps)
|
|||||||
derivation *
|
derivation *
|
||||||
parse_state_derivation (const parse_state *ps)
|
parse_state_derivation (const parse_state *ps)
|
||||||
{
|
{
|
||||||
return (derivation *)ps->derivs.head_elt;
|
return (derivation *) ps->derivs.head_elt;
|
||||||
}
|
}
|
||||||
|
|
||||||
const state_item *
|
const state_item *
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
Simulating states of the parser:
|
Simulating states of the parser:
|
||||||
Each state is an array of state-items and an array of derivations.
|
Each state is an array of state-items and an array of derivations.
|
||||||
Each consecutive state-item represents a transition/goto or production,
|
Each consecutive state-item represents a transition/goto or production,
|
||||||
and the derivations are the dereivation trees associated with the symbols
|
and the derivations are the derivation trees associated with the symbols
|
||||||
transitioned on each step. In more detail:
|
transitioned on each step. In more detail:
|
||||||
|
|
||||||
Parse states are stored as a tree. Each new parse state contains two "chunks,"
|
Parse states are stored as a tree. Each new parse state contains two "chunks,"
|
||||||
|
|||||||
Reference in New Issue
Block a user