Home | Download | Wiki | About ANTLR | Feedback | Support |


Latest version is 2.7.7.
Download now! »

Download
» Home
» Download
» News
»Using ANTLR
» Documentation
» Wiki
» FAQ
» Articles
» Grammars
» File Sharing
» Code API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»TML
»PCCTS
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



Getting Started with ANTLR

Getting Started with ANTLR

Languages, parsing, and translation are still considered a "black art", but tools like ANTLR can help eliminate some of the mystery and make you very efficient at building translators. Getting started with ANTLR is pretty easy if you start playing around with some existing grammars and read some introductory material. As you progress, you will want to check out more advanced topics and play around by working with bigger grammars. Also please join us on the antlr-interest mailing list for active discussions on ANTLR and languages.

  1. Download ANTLR 2.7.6. First you have to get the software.
  2. Try a cut-n-paste example. If you have trouble getting the ANTLR tool to start, read Why do I get the following Java interpreter error: "Can't find antlr/Tool"?.
  3. To learn a bit more, read All I know is that I need to build a parser or translator. Give me an overview of what ANTLR does and how I need to approach building things with ANTLR. Here is another description about parsing simple data.
  4. To learn about language recognition, you should read the chapter on Building Translators from the work in progress Practical Computer Language Recognition and Translation book.

The following tutorials should also be useful to you:

That should give you a taste of how to run ANTLR on a simple grammar and some clue about how to build a recognizer and translator. From here, you should start with an existing grammar that is similar to your intended application and start modifying it. When you run into questions, first examine the output (and source of ANTLR if you want) to see if you can answer your own question. Then you should check the following: