January 2013
Intermediate to advanced
328 pages
8h 5m
English
Writing a grammar is a lot like writing software except that we work with rules instead of functions or procedures. (Remember that ANTLR generates a function for each rule in your grammar.) But, before focusing on the rule innards, it’s worth discussing the overall anatomy of a grammar and how to form an initial grammar skeleton. That’s what we’ll do in this section because it’s an important first step in any language project. If you’re itching to build and execute your first parser, you can revisit Chapter 4, A Quick Tour or jump to the first example in the next chapter: Parsing Comma-Separated Values. Feel free to pop back and forth to the examples in the next chapter as we learn the fundamentals ...
Read now
Unlock full access