|
ANTLR 3 (http://antlr.org) is a Java-based tool that generates
language parsers in a variety of programming languages including Java.
It differs from most other parser generators in that it supports
unlimited lookahead to select between grammar rule alternatives.
This talk will walk through implementation of a
domain-specific language (DSL) using ANTLR.
While languages such a Ruby and Groovy can also be used to implement
DSLs, they bring with them the baggage of their own syntax rules.
ANTLR allows you to make the syntax of your DSL be exactly what you want to be.
We'll start with lexer rules to break a character stream into tokens,
write parser rules that build an abstract syntax tree,
and write tree parser rules that walk the AST and
execute the code that was fed to the lexer.
We'll also demonstrate use of ANTLRWorks which is a
free graphical editor and debugger for ANTLR grammars.
It is particularly useful in stepping through the construction of ASTs.
After attending this talk you'll be ready to begin using ANTLR
to implement your own languages.
|