- Series: Pragmatic Programmers
- Paperback: 374 pages
- Publisher: Pragmatic Bookshelf; 1 edition (January 10, 2010)
- Language: English
- ISBN-10: 193435645X
- ISBN-13: 978-1934356456
- Product Dimensions: 7.5 x 0.8 x 9.2 inches
- Shipping Weight: 1.4 pounds (View shipping rates and policies)
- Average Customer Review: 35 customer reviews
- Amazon Best Sellers Rank: #173,905 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Pragmatic Programmers) 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Fulfillment by Amazon (FBA) is a service we offer sellers that lets them store their products in Amazon's fulfillment centers, and we directly pack, ship, and provide customer service for these products. Something we hope you'll especially enjoy: FBA items qualify for FREE Shipping and Amazon Prime.
If you're a seller, Fulfillment by Amazon can help you increase your sales. We invite you to learn more about Fulfillment by Amazon .
Frequently bought together
Customers who bought this item also bought
Customers who viewed this item also viewed
""Throw away your compiler theory book! Terence Parr shows how to write practical parsers, translators, interpreters, and other language applications using modern tools and design patterns. Whether you're designing your own DSL or mining existing code for bugs or gems, you'll find example code and suggested patterns in this clearly written book about all aspects of parsing technology.""--Guido van Rossum, Creator of the Python language
""This text is excellent. The exposition plus the examples makes otherwise complex ideas very clear and accessible. Well done!""--Tom Nurkkala, Associate Professor, Computer Science and Engineering, Taylor University
About the Author
Terence Parr is a professor of computer science and graduate program director at the University of San Francisco, where he continues to work on his ANTLR parser generator (http://www.antlr.org) and template engine (http://www.stringtemplate.org). Terence has consulted for and held various technical positions at companies such as IBM, Lockheed Missiles and Space, NeXT, and Renault Automation. Terence holds a Ph.D. in computer engineering from Purdue University and was a postdoctoral fellow at the Army High-Performance Computing Research Center at the University of Minnesota, where he built parallelizing FORTRAN source-to-source translators. He is the author of "The Definitive ANTLR Reference":http://pragprog.com/titles/tpantlr.
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
And it is not because it does not have some ideas presented, it has -- but almost everything is done in such twisted way, that instead of boosting your performance, it actually slows you down. Take any sentence -- and I knew less after reading it, than before. It is like asking a stranger about time, and listening in return to mumbling about how time in general is an interesting concept, the ways of measuring time, and in the end getting info, it is about the same time, as last Sunday. All of those information are absolute true, correct, but not useful in context of the question.
My question for this book was -- "how to build my own DSL using ANTLR?" -- and it failed to delivered clear answer. Here is why...
The book has three layers -- how would you do given task in general (in theory), how would you write ANTLR, and in the end how would you use ANTLR. I did such distinction myself, because for the author everything blends in, so when you read some parts you could be surprised "should I write all this stuff?" to guess some time later, that you saw ANTLR internals, which are already written. This smooth moving from one layer to another was a problem for me, because I always missed which part should I implement by myself, and which is already implemented.
Every layer has flaws starting from basic problems -- the book is too thin to fit good explanation of all of them. In my opinion the author should decide on one topic and focus solely on it -- either it is theory book or book about using ANTLR -- here you have little this, little that, and in fact for good understanding of theory you should get another book, for good understanding of ANTLR you should use also another book (actually there is only just one: The Definitive Antlr Reference: Building Domain-Specific Languages (Pragmatic Programmers)), and for writing ANTLR -- I don't know what you should get, because I don't intend to do it.
Whenever some code is presented you will be surprised by author's style of compressing space -- since it is printed book, not only you won't get any substitution of syntax highlighting, but you will read through "if's" single-liners, or even "try-catch" blocks as single-lines. The code, presented after all in educational purpose, looks more like the result of obfuscator.
The theory part (of scanning and parsing) is the best of this book (it does not mean it is good), it is possible to get some knowledge out of it, but if you are interested in those stages I would not recommend this book to learn about them. The later stage in compiling are described using heavily ANTLR, and it is obscure as everything about ANTLR in this book.
The ANTLR internals part -- I didn't pay too much attention to it, because I don't understand why should I read about it in the first place. I have an input, I need the output, I am writing for example a grammar (for parsing), not a parser. This part is a mistake.
This leaves using ANTLR -- I had high hopes for it, and it was at the same time the biggest disappointment. I already mentioned it is hard to dissect this part from the others (especially from ANTLR internals), but worse -- for parsing, the key point for me -- there is more about internals of ANTLR, than using ANTLR! With some struggle I figured out how to write a grammar in ANTLR, just to find out the next chapter (generating AST) is not based on parsing! Instead of gradually creating more and more advanced DSL (for example) it uses disjoint examples of algorithms implemented in ANTLR -- for AST it manually "injects" symbols to show how AST is built. Did you see AST building for which the source was not parsing?
After reading the book instead of having complete picture of the tool I have a blurry images of how the scanning is done, how parsing is done, how can I create AST (in several ways), how to optimize... but how I should connect those stages -- I have no idea.
In the end I gave up -- the book and ANTLR altogether (only after reading a book I found out I would fail anyway, because I aimed to use C#, and ANTLR and C# is not a reliable pair). This experience was one of the most frustrating in my life, because I really tried to understand how to use ANTLR, I had solid background (at the time of reading, I already written all stages of compiler), yet I couldn't move past AST because of all this mumbling -- there are regular, irregular, homogeneous, heterogeneous trees (why does the parser have to know it?) but how to build any of those trees using output from parser -- silence. On the other hand there is big chapter about traversing trees (in general).
Maybe ANTLR is over engineered, maybe I am not smart enough for this book, however I spent about 2 months with both books by Terence Parr, without any success, and on the other hand I was so annoyed that I wrote from scratch lexer and LALR parser in 3 weeks. If I can still do the math, it means, I spent less time on my custom tools and in result I got even better understanding about building compilers. Also I found much better books -- so in perspective of time, the time spent on reading this book was complete waste, because I didn't learn literally anything new. It was an obstacle for me, not a help. It kept me thinking about artificial problems (like choosing heterogeneous or homogenous trees; artificial -- because the choice is ANTLR requirement) instead of moving forward to solving the problem.
It goes without saying, I don't recommend this book -- simply put, avoid it. It is a mixture of solid knowledge, but the mixture is badly served. If you would like to learn about ANTLR (up to parsing and evaluating parse tree), I highly recommend free ANTLR 3.x Tutorial by Scott Stanchfield (use google; the same topic, ANTLR, but what a difference in teaching).
If you would like to learn about building compiler using existing tools for scanning and parsing, I think Modern Compiler Implementation in Java could be a good pick as introductory book (however I didn't read entire book, so I cannot say I recommend it or not). If you are interested in building your own parser, a killer book -- Parsing Techniques: A Practical Guide (Monographs in Computer Science).
And if you prefer video lectures instead of a book, I could not praise enough Alex Aiken's Compilers course (free on Coursera platform), now I can hardly stand anything less concise.
All those resources are good examples, that no matter what topic, you can always use clear language and explain the problem in understandable manner. And if you start with them I doubt you will ever find this book useful, not mentioning, well written.
Plenty of people much more educated and experienced in the art and science of language design than I am will surely write insightful reviews about the merits of this book from the perspective of specialists. I'm writing this review for the rest of us.
Terence Parr continues his campaign to make superb language-development tools accessible. Have you ever wondered how your compiler really works? Maybe you've dreamed about creating your own scripting language -- the one that works the way *you* want -- but you're not Larry Wall. Well, take heart. Professor Parr's second ANTLR book is here. Maybe you never took a course in compiler design (I haven't.) or maybe you have and are still wondering how to do anything practical with it. This book is for you. You very well might not become the next Guido van Rossum, but you will come away with a deeper appreciation of language implementation -- probably enough to create your personal dream language.
I call this the "second ANTLR book," but that's a gross oversimplification. If you already know that ANTLR stands for ANother Tool for Language Recognition, then the next thing you need to know is that this book is about much more than ANTLR. You also may know that ANTLR is written in Java. But you don't need to know Java to get value from this book. (In fact ANTLR itself can target C, C# and several other languages besides Java.) Although the book uses ANTLR to describe example languages, and Java to implement them, the author very cleanly separates concepts from tools and implementation details, in a way which is consistently pragmatic and never drifts off into the clouds. There is no pedagogic hand-waving here. This is the real stuff. And when you grasp it, you too will be able to create everything from "simple" data format translators to script interpreters and maybe even some non-optimizing compilers. Really.
Most recent customer reviews
Remember that material is useful for everyone but code will not work with ANTLR...Read more