简体   繁体   中英

LALR, LR(1) and SLR

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM