Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleThe Definitive ANTLR Reference

Image Modified To get the most out of ANTLR, you should get The Definitive ANTLR Reference: Building Domain-Specific Languages. The book describes all features in detail, including the amazing new LL(*) parsing technology, tree construction facilities, StringTemplate code generation template engine, and sophisticated ANTLRWorks GUI development environment. You'll learn all about ANTLR grammar syntax, resolving grammar ambiguities, parser fault tolerance and error reporting, embedding actions to interpret or translate languages, building intermediate-form trees, extracting information from trees, generating source code, and how to use the ANTLR Java API. The definitive reference is required reading to become an advanced user. For example, Part III provides the only thorough explanation available anywhere of ANTLR's LL(*) parsing strategy.

...

  1. First you have to get the software: Download ANTLR v3 and install it (see How do I install this damn thing?) or get the ANTLRWorks grammar development environment, which includes ANTLR. You can just click on the ANTLRWorks jar to get started.
  2. Try a cut-and-paste example such as Expression evaluator either by pasting into ANTLRWorks and running the interpreter or debugger (see ANTLRWorks tutorial) or using an editor and manually invoking ANTLR from the command line (see How do I use ANTLR v3 from the command line?).
  3. Try modifying an existing grammar; change actions and rule elements to see what happens. You can look for grammar in the ANTLR grammar list (though, most of them are currently v2 grammars) or take a look at some of the ANTLR v3 examples.

If you are familiar with ANTLR v2, check out Migrating from ANTLR 2 to ANTLR 3.

...