Considering this expression:
3 + 2 + 2 * 2 = ?
Would it be 14?
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.
No. That’s what you’d get in left-to-right evaluation. An LL parser would build the same parse tree as an LR parser,
and evaluate it as
which is 9, as you’d expect.
What is special about LL parsers is that, for a restricted grammar, they can always proceed left to right with limited look-ahead. This makes them easy to describe and easy to parse; some Pascal is one of the most common languages that is LL.
You might have a look at the Wiki article on leftmost derivation.