Possible lesson: don’t get upset with a book for not being a completely different book the author hasn’t written yet, but will later.
I few months ago I bought The Definitive ANTLR Reference by Terence Parr1. The book’s subtitle is “Building Domain-Specific Languages,” so I was rather disappointed when I found out that it has absolutely no information on building domain-specific languages — or any other applications — using ANTLR. It’s a great ANTLR reference, but doesn’t have any examples of using ANTLR to do anything other than just parse (and emit and handle parsing errors). Without any practical examples, it took bit of head-scratching on my part to realize how to even e.g. make my Z-code assembler available to my ANTLR-generate AST walker.
But today I learned that Terence Parr has also written another book titled Language Implementation Patterns. I haven’t had a chance to read much of it yet, but it looks like exactly what I wanted in the first place — a guide to actually writing various sorts of applications which involve parsing languages, mostly using ANTLR-generated parsers. This book has the oddly-similar subtitle “Create Your Own Domain-Specific and General Programming Languages,” but which seems rather more apt here. In any case, I’m looking forward to it.
And on a side note, Parr’s publisher, the Pragmatic Bookshelf, kicks ass. Their e-book deployment is even better than O’Reilly’s. While both provide PDF, Mobipocket, and EPUB versions for perpetual re-download, the PragProgs also (a) offer almost their entire catalog as e-books, and (b) make e-book editions available as “beta books” several months prior to the print release date. In fact, Language Implementation Patterns is currently only available in an e-book beta version. But available it is, for delicious pre-final-draft reading by the adventurous.
1 Primary author of ANTLR, so you can see the draw.