From what I have searched on Google so far, the only difference between LALR(1) and SLR(1) is that LALR(1) uses states with merged lookahead sets. One source says that LALR(1) won't run into shift-reduce conflicts because the parser will "remember" from which state it arrived at the current state. However, there are no differences in the parsing algorithm, so I'm having trouble seeing how these merged lookahead sets would help the LALR parser resolve shift-reduce conflicts. And if the parser remembers from which state it arrived at the current state, why is it still vulnerable to reduce-reduce conflicts?

  • 1
    $\begingroup$ Answered here, because I noticed it there first. Please don't double-post; it only creates confusion. $\endgroup$ – rici Jun 4 '16 at 18:07
  • $\begingroup$ I'm voting to close this question because it was simultaneously cross-posted on Stack Overflow, which violates SE rules. $\endgroup$ – D.W. Jun 5 '16 at 2:39

Browse other questions tagged or ask your own question.