Part 3Advanced Topics
In Part II, we learned how to abstract language structure (syntax) from language samples and reference manuals and then how to formally describe syntax with ANTLR grammars. To develop language applications, we built several tree listeners and visitors that operated on automatically generated parse trees. Now we have the keys to effectively use ANTLR for most problems.
Part III is about advanced usages of ANTLR. First, we’ll examine ANTLR’s automatic error handling mechanism. Then, we’ll explore how to embed code snippets directly within a grammar in order to generate output or perform computations on-the-fly during the parse. Then we’ll see how to dynamically turn alternatives in the grammar on and off based upon runtime ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access