I'm reading the Dragon book. The beginning describes recursive descent parsers. Then it states that a predictive parser is the table version of a RD parser.

I also read up on LALR(1) parsers.

The differences between predictive and LALR parsers seem superficial to me. LALR seems to consume terminals quickly, but the predictive parser will do that too if the grammar is properly prepared (for example, by converting it to Greibach Normal Form.)

What am I missing? What is LALR's advantage?

  • $\begingroup$ Converting to GNF does not let you parse; you lose the structural information. It's fine if you only want to recognize. But I suggest you keep reading. There are examples of grammars which are LALR and not LL (possibly in the exercises, which are worth doing too). $\endgroup$
    – rici
    Oct 17 '14 at 4:28

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.