lalr: clarify the API

* src/state.h, src/state.c (state_reduction_find): Clarify.
Die on errors.
* src/lalr.c (goto_list_new): New.
Use it.
This commit is contained in:
Akim Demaille
2019-02-27 18:33:47 +01:00
parent c837141832
commit e062b9f70d
3 changed files with 14 additions and 6 deletions

View File

@@ -239,6 +239,8 @@ void state_transitions_set (state *s, int num, state **dst);
/* Set the reductions of STATE. */
void state_reductions_set (state *s, int num, rule **reds);
/* The index of the reduction of state S that corresponds to rule R.
Aborts if there is no reduction of R in S. */
int state_reduction_find (state *s, rule const *r);
/* Set the errs of STATE. */