Cerecke's thesis is a goldmine of edge case examples. One of them shows up a problem which I sort-of knew we had, but which turned out to be much worse than I thought. Because (like Kim & Yi) we use the stategraph to guide repairs, it's obvious that, for grammars that have shift/reduce or reduce/reduce errors, we would find different repairs than the statetable. I assumed that we would simply find a superset of repairs, but I was wrong: Cerecke has an example that shows we produce repairs which are a) not the lowest possible cost (!) b) can't be parsed by the statetable.
After adding a couple of tests, this PR thus fixes this problem in https://github.com/softdevteam/lrpar/commit/09a567bbd13e729864028ea31ae3205e85ee5953. As a happy bonus this means that (apart from the Dist calculation) we no longer have any reliance on the stategraph. Since Dist can be calculated at compile-time, this means that the MF recoverer does not, ultimately, need to keep the stategraph around at run-time. That will, one day, enable it to take up less memory when it generates static grammar tables (a la Yacc).
NB: Needs https://github.com/softdevteam/lrtable/pull/88 to be merged first.
Cerecke's thesis is a goldmine of edge case examples. One of them shows up a problem which I sort-of knew we had, but which turned out to be much worse than I thought. Because (like Kim & Yi) we use the stategraph to guide repairs, it's obvious that, for grammars that have shift/reduce or reduce/reduce errors, we would find different repairs than the statetable. I assumed that we would simply find a superset of repairs, but I was wrong: Cerecke has an example that shows we produce repairs which are a) not the lowest possible cost (!) b) can't be parsed by the statetable.
After adding a couple of tests, this PR thus fixes this problem in https://github.com/softdevteam/lrpar/commit/09a567bbd13e729864028ea31ae3205e85ee5953. As a happy bonus this means that (apart from the
Dist
calculation) we no longer have any reliance on the stategraph. SinceDist
can be calculated at compile-time, this means that the MF recoverer does not, ultimately, need to keep the stategraph around at run-time. That will, one day, enable it to take up less memory when it generates static grammar tables (a la Yacc).