I’m trying to prove that LL(3) is not a subset of LR(2).
Intuitively it’s easy, but I can’t point my intuition into finding such a grammar.
Could you please give me a hand? Thanks for any help
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Theorem: If a grammar is LL(3) but not LR(2), then the grammar has ε-productions.
Proof: A grammar is LL(3) if it always is possible to identify the handle in a right sentential form after reading three characters past the beginning of the handle.
A grammar is LR(2) if it always is possible to identify the handle in a right sentential form after reading two characters past the end of the handle.
If a grammar is LL(3) but not LR(2), then reading three characters past the beginning of the handle must sometimes provide more information than reading two characters past the end of the handle. That can only happen if the handle is empty.