Chapter 23. Parser Generator

Build a parser driven by a grammar file as a DSL.

image

A grammar file is a natural way of describing the syntactic structure of a DSL. Once you have a grammar, it’s tedious work to turn it into a handwritten parser, and tedious work should be done by a computer.

A Parser Generator uses this grammar file to generate a parser. The parser can be updated merely by updating the grammar and regenerating. The generated parser can use efficient techniques that would be hard to build and maintain by hand.

23.1 How It Works

Building your own Parser Generator is no simple task, and anyone who is capable of doing such a thing is ...

Get Domain Specific Languages now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.