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

@@ -218,7 +218,7 @@ state_reduction_find (state *s, rule const *r)
for (int i = 0; i < reds->num; ++i)
if (reds->rules[i] == r)
return i;
return -1;
abort ();
}