O'Reilly logo

Domain Specific Languages by Martin Fowler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required