1

Since LR (1) grammars are broader than LALR or SLR grammars, I have doubts regarding the proof of LR grammars. If a grammar is SLR or LALR, then does that mean that the grammar is also LR (1)?

In fact, since the method that uses lookaheads is more complex to carry out, I can therefore use the SLR method (without lookahead) or the LALR method to prove that a grammar is LR (1).

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
xXMarcoXx
  • 11
  • 4

1 Answers1

2

If a grammar is SLR(k) or LALR(k) then it also LR(k). If a conflict is found while constructing the LR parser, that same conflict will be present in an LALR or SLR parser for the same grammar.

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
rici
  • 234,347
  • 28
  • 237
  • 341