Review of 'The Definitive Antlr 4 Reference' on 'Goodreads'
5 stars
What an emotional rollercoaster!
I went from being a true believer in a language-agnostic event-based parsing in order to keep the code out of the grammar to maximize reuse... to a true believer in the impossibility of keeping code out of the grammar, since it inevitably needs to ask for higher level context from some other module or have embedded predicates in order to parse some things correctly and efficiently... within a few week span.
It feels like a fairly good solution to the leaky abstraction of separate lexer, parser, and app components, but there are a ton of unexplained ramifications to this stuff, and to rewriting Left-recursive phrases. It leaves me with a pseudo-religious dread, as if I discovered an ancient stone room behind a wall while remodeling a basement.
Most of the book explores trivial examples not actually compliant with any language spec. I wish we could have …
What an emotional rollercoaster!
I went from being a true believer in a language-agnostic event-based parsing in order to keep the code out of the grammar to maximize reuse... to a true believer in the impossibility of keeping code out of the grammar, since it inevitably needs to ask for higher level context from some other module or have embedded predicates in order to parse some things correctly and efficiently... within a few week span.
It feels like a fairly good solution to the leaky abstraction of separate lexer, parser, and app components, but there are a ton of unexplained ramifications to this stuff, and to rewriting Left-recursive phrases. It leaves me with a pseudo-religious dread, as if I discovered an ancient stone room behind a wall while remodeling a basement.
Most of the book explores trivial examples not actually compliant with any language spec. I wish we could have taken a deep dive into a few real language specs to quantify the difference between an easy start and a complete job. Additional use cases would be handy; most of the run-of-the-mill cases would be handled by some grepping.
Also missing was a discussion on the time and space complexity of different options and language constructs. How much longer will my parser take to run using option A vs option B?
Overall, I feel like I know very little about the depth of the projects I want to create with ANTLR 4. Just enough to be dangerous.