0
$\begingroup$

In theory, given that:

  • The LALR parser can be constructed by merging LR(1) states with the same core;
  • If $I$ is a LR(1) set of items, then $\text{core}(\text{GOTO}(I))=\text{GOTO}(\text{core}(I))$;

the SLR and LALR automata should be isomorphic.

$\endgroup$
  • $\begingroup$ If an SLR parser exists, it is the same as the LALR parser. But it might not exist because the SLR algorithm produces conflicting actions where the LALR algorithm produces deterministic parsing tables. In these cases, even if you allow the SLR automaton to exist (perhaps as an NFA), it must differ from the LALR automaton in some transition. But the two automata do have the "same" states. $\endgroup$ – rici Sep 8 '20 at 17:22
  • $\begingroup$ @rici I'm assuming a parser can exist with conflicts. I'm asking if, in the parsing table, the shift actions are the same everywhere. Edit: by automaton I mean the state graph. $\endgroup$ – giofrida Sep 8 '20 at 18:07
  • $\begingroup$ yes, i think that's correct. $\endgroup$ – rici Sep 8 '20 at 19:28
  • $\begingroup$ @rici thank you $\endgroup$ – giofrida Sep 8 '20 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.