Search code examples
parsingrecursive-descent

Recursive descent parser: how to find the FIRST, FOLLOW, and PREDICT sets?


I'm looking for a good explanation of the definitions of the FIRST, FOLLOW, and PREDICT sets of a RDP when given a grammar.


Solution

  • Try Programming Language Pragmatics, by Michael L. Scott (Morgan Kaufmann). Parsing is covered in chapter 2. Recursive-descent parsing is described in section 2.2.3; first and follow sets in 2.2.5.