Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Are there any good tutorials for ANTLR, targeting v3.x? (The ANTLR website is not friendly to new users.)

share|improve this question
+1 for being closed – ceving Dec 6 '12 at 11:02

closed as not constructive by casperOne Aug 2 '12 at 12:48

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

9 Answers

up vote 60 down vote accepted

I've just posted the start of a video tutorial on ANTLR 3.x at

Hope this helps! -- Scott

share|improve this answer
Your series of tutorials were extremely helpful; many thanks! :D – Midnight Blue Sep 22 '10 at 21:00
Thanks! Glad you found them useful! – Scott Stanchfield Sep 29 '10 at 20:27
It's a pity that those aren't in text. Moreover as I looked at the first video it seams to be assuming that I'm going to use eclipse (the first videos shows some "grammar interpreter") – krzyk Nov 5 '11 at 7:22
Had I done it in text there would have been about 1/3 of the content... Text just takes so much longer, and it's really hard to be descriptive. As for using eclipse - you should be ;) If not, I'm only using eclipse to edit and run some simple tests in the interpreter. There's no reason you couldn't do the same things outside eclipse, but because I don't develop that way, I don't have tutorials on it. – Scott Stanchfield Dec 30 '11 at 18:27
Your video series helped me a lot. Thanks for creating them. I personally wrote some posts about how to use ANTLR on C#/.NET, – Lex Li Jul 11 '12 at 5:21 (ANTLR3)- did magic to me in learning ANTLR.

share|improve this answer

The best way to learn ANTLR is from Mr. Parr's book as previous messages have pointed to. Perhaps these short tutorials will be useful, too:

From the ANTLR site, a Getting Started guide (you've probably seen this).

Very short example from Martin Fowler.

Very good tutorial, but it is based on ANTLR 2.0 (it's now at version 3.1).

This tutorial appears to use ANTLR 2.7.

In addition to these, which are tutorials based around a short example, there are lots of more extensive examples. You can search for those as you get more confidence.

share|improve this answer
Thanks for the "very good" on my ANTLR 2.x tutorial. I hope to have time to make a 3.x version someday... – Scott Stanchfield Mar 24 '09 at 16:12
See my answer about my ANTLR 3.x tutorial videos – Scott Stanchfield Sep 29 '10 at 20:26
Mr. Parr's book is more documentation/specification than a learning aid. Using it to learn ANTLR is like learning C# from the C# Specification, by which I mean this: if you're already familiar with the background domain (compiler theory and parsing) it is probably possible. If not, you are probably going to be rapidly confused by the various descriptions and specifications of features which seemingly have no bearing on practical matters. The vast majority of people do better learning technologies from concrete examples, and hence I would argue a tutorial is a better way than reading the book. – fostandy Mar 27 at 1:53
And I'm aware the Definitive ANTLR Reference has a tutorial of sorts in Chapter 3. I've tried it, and IMO there are far better tutorials to use. No disrespect to Mr Parr's book - it looks like an excellent reference but certainly not the best introductory text to either ANTLR. – fostandy Mar 27 at 2:00

I just found this bright and exhaustive blog series by Bart, the top Antlr user here. It walks though creating a small dynamic programming language with functions, loops, etc. It starts with a simple parser and gets to actually evaluating code.

share|improve this answer

The Definitive ANTLR Reference is very use full, but can in my experience be a bit hard to use for a beginner.

A second book is on its way which looks like a more "hands on" book - both of them combined might be a good starting point for a beginner.

share|improve this answer

I hope this tutorial will help you get started (if not yet :) Terence book is little hard to begin with

share|improve this answer

Perhaps this book could be useful for you. You can buy it in PDF format.

I don't have any experience on ANTLR but the books from these guys are excellent. I have more than a dozen in my bookshelf.

share|improve this answer
I've used it when hacking with ANTLR, really good! – abyx Nov 10 '08 at 18:35

I was similarly disappointed with the availability of tutorials for ANTLR when I started using it a few years ago. However, the good news is that Terence Parr (the author of ANTLR) has recently published a book on ANTLR, which is probably the best place to start.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.