January 2013
Intermediate to advanced
328 pages
8h 5m
English
Now that we know how to formally define languages using ANTLR grammar syntax, it’s time to breathe some life into our grammars. By itself, a grammar isn’t that useful because the associated parser tells us only whether an input sentence conforms to a language specification. To build language applications, we need the parser to trigger specific actions when it sees specific input sentences, phrases, or tokens. The collection of phrase → action pairs represents our language application or at least the interface between the grammar and a larger surrounding application.
In this chapter, we’re going to learn how to use parse-tree listeners and visitors to build language applications. ...
Read now
Unlock full access