December 2009
Intermediate to advanced
380 pages
9h 2m
English
Building recursive-descent parsers in a general-purpose programming language is tedious and error-prone. We have to type the same code templates over and over again. It’s much more productive to use a DSL specifically designed for describing languages. “Programs” in this DSL are called grammars. Tools that translate grammars to parsers are called parser generators. Grammars are concise and act like functional specifications for languages. They are much easier to read than the equivalent recursive-descent parser implementations.
Substructures in the parse tree and functions in the parser correspond to rules in a grammar. The children of a substructure become references to rules and tokens on the right side ...
Read now
Unlock full access