In SLR we use follow set of a non terminal for determining reduce moves and in CLR we use lookaheads for the same.

How does using lookaheads actually help in improving the performance of the parser ?

Why is computing lookahead better than computing follow set for parsing ?

  • $\begingroup$ Because it is more precise. You'll find examples of LR grammars which are not SLR in any compilers/formal languages textbook. $\endgroup$ – rici Aug 30 '17 at 3:06
  • $\begingroup$ Yes I have seen some examples in books but I am not able to understand the exact reason on how lookaheads help in being more precise. $\endgroup$ – Zephyr Aug 30 '17 at 5:15

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.