Jump to ratings and reviews
Rate this book

The Definitive Antlr Reference: Building Domain-specific Languages

Rate this book
ANTLR v3 is the most powerful, easy-to-use parser generator built to date, and represents the culmination of more than 15 years of research by Terence Parr. This book is the essential reference guide to using this completely rebuilt version of ANTLR, with its amazing new LL( ) parsing technology, tree construction facilities, StringTemplate code generation template engine, and sophisticated ANTLRWorks GUI development environment. Learn to use ANTLR directly from the author! ANTLR is a parser generator -a program that generates code to translate a specified input language into a nice, tidy data structure. You might think that parser generators are only used to build compilers. But in fact, programmers usually use parser generators to build translators and interpreters for domain-specific languages such as proprietary data formats, common network protocols, text processing languages, and domain-specific programming languages. Domain-specific languages are important to software development because they represent a more natural, high fidelity, robust, and maintainable means of encoding a problem than simply writing software in a general-purpose language. For example, NASA uses domain-specific command languages for space missions to improve reliability, reduce risk, reduce cost, and increase the speed of development. Even the first Apollo guidance control computer from the 1960s used a domain-specific language that supported vector computations. This book is the definitive guide to using the completely rebuilt ANTLR v3 and describes all features in detail, including the amazing new LL( ) parsing technology, tree construction facilities, StringTemplate code generation template engine, and sophisticated ANTLRWorks GUI development environment. You'll learn all about ANTLR grammar syntax, resolving grammar ambiguities, parser fault tolerance and error reporting, embedding actions to interpret or translate languages, building intermediate-form trees, extracting information from trees, generating source code, and how to use the ANTLR Java API.

361 pages, Paperback

First published May 17, 2007

4 people are currently reading
43 people want to read

About the author

Terence Parr

16 books24 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
15 (17%)
4 stars
41 (48%)
3 stars
23 (27%)
2 stars
4 (4%)
1 star
1 (1%)
Displaying 1 - 8 of 8 reviews
Profile Image for Paul Newman.
6 reviews10 followers
Read
November 20, 2019
I started reading it AFTER a lot of recommendations but it wasn't gone up to the standards. Maybe it's just me, but I was expecting more.
Profile Image for Glenn.
21 reviews1 follower
November 16, 2010
This USF CS professor has two main inventions to his credit, ANTLR and string template. This book gives Java developers almost everything you might need to learn how to use these two technologies.

ANTLR is ANother Tool for Language Recognition which empowers developers to embed the ability to use domain specific languages into their applications. With ANTLR, you specify a grammar, run a tool to generate the parser and lexer code from the specification, and call that parser and lexer from within your application.

Terrence Parr is the consummate educator and the book's organisation shows it. He starts with a high-level overview into the computer science problem of formal language parsing. Then he follows up with a quick start tutorial on how to get your first ANTLR program written. Now that he has whetted your appetite, you get the complete reference materials on all features of ANTLR. After that comes a deep dive into compiler theory as it relates to ANTLR.

The guide is definitive but let's not over promise on what any single book can do. If you have never taken any college level courses on Chomsky's Theory of Formal Languages or compiler theory, then you may not come to completely understand and appreciate every nuance of ANTLR. Even so, if any book can get you up and running with ANTLR, then it will be this book. It was this resource that permitted me to host ANTLR in a Java servlet as a weekend project.
Profile Image for Glenn Burnside.
194 reviews9 followers
July 11, 2011
If you're going to use ANTLR for building custom languages, you NEED this book. It's the definitive reference (says so right in the title!) by the ANTLR author. Any time somebody's spent 20+ years in a specific programming niche like Parr has, you know he's got insight that you don't.

The book's a little rambly sometimes, and I would have appreciated some more concrete examples of WHY I would use some of the more esoteric ANTLR features, but I appreciate the fact that pretty much every last dusty corner of ANTLR is covered here, as well as the ancillary tools.
Profile Image for Zhi Han.
74 reviews14 followers
Read
July 7, 2014
ANTLR is a really cool tool. And this book is well written. The fist part of the book is quite nicely written. The examples with code, however, are not so great. I would recommend it if it has a working simple example that actually include all ANTLR features (parsing, tree grammar + code generation). The book only contains examples with (parsing + tree grammar) and (parsing + code generation). And I had a few hard hours flipping back and forth between to put together my hello world example.
225 reviews12 followers
August 28, 2008
a must-have for any serious user of ANTLR. but there is way too much stuff that is not covered here to be able to call it a "definitive reference".

this book feels like the author just started writing down everything he knew about the tool he created. when he was done, he might have drafted it and reorganized a bit, but he was more or less done.
19 reviews
January 6, 2015
Great parser generator. Great reference.
I thought the book had a superior coverage and organization than the content on antlr.org (which is also good), but then I am biased towards books.

If you've suffered the purgatory that is javacc, rolled your own, or played with lax/yacc or others definitely have a look at antlr. Bravo Dr. Parr.
226 reviews2 followers
Read
May 11, 2010
Creating Web Pages for Dummies
Displaying 1 - 8 of 8 reviews

Can't find what you're looking for?

Get help and learn more about the design.