mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
style: factor the access to a rule from its items
* src/counterexample.c (item_rule): Move to... * src/counterexample.h: here. * src/AnnotationList.c, src/counterexample.c, src/ielr.c: Use it.
This commit is contained in:
10
src/gram.h
10
src/gram.h
@@ -237,7 +237,15 @@ print_dot (FILE *out)
|
||||
}
|
||||
|
||||
/* Get the rule associated to this item. ITEM points inside RITEM. */
|
||||
rule const *item_rule (item_number const *item);
|
||||
static inline rule const *
|
||||
item_rule (item_number const *item)
|
||||
{
|
||||
item_number const *sp = item;
|
||||
while (!item_number_is_rule_number (*sp))
|
||||
++sp;
|
||||
rule_number r = item_number_as_rule_number (*sp);
|
||||
return &rules[r];
|
||||
}
|
||||
|
||||
/* Pretty-print this ITEM (as in the report). ITEM points inside
|
||||
RITEM. PREVIOUS_RULE is used to see if the lhs is common, in which
|
||||
|
||||
Reference in New Issue
Block a user