Expose lower stack nodes via pop_until() function

This callback-based API allows the parser to easily visit each interior node
of the stack when searching for an error repair. It also is a better abstraction
over the stack's DAG implementation than having the public functions for
accessing entries and their successor entries.
This commit is contained in:
Max Brunsfeld 2016-03-07 16:03:23 -08:00
parent bc8df9f5c5
commit 4348eb89d4
9 changed files with 417 additions and 295 deletions

View file

@ -21,6 +21,9 @@ extern "C" {
#define array_init(self) \
((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL)
#define array_new() \
{ NULL, 0, 0 }
#define array_get(self, index) \
(assert((size_t)index < (self)->size), &(self)->contents[index])