parsingcompiler-constructionlr-grammarlalr

Should a merge failure stop the LR(1) to LALR(1) conversion


Let's say I have got a set of LR(1) states and I want to try to convert it to LALR(1). I did the first step of finding states that have got the same LR(0) core and now I'm doing the merge process. However one of such set of states can't be merged, because it would introduce RR conflict(s). Should I:


Solution

  • The conflict is not going to go away with more merges, so you could stop immediately and report failure.

    Most parser generators would continue to the end, though: