Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 428245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:39:24+00:00 2026-05-12T19:39:24+00:00

I have started to learn ANTLR and have both the 2007 book The Definitive

  • 0

I have started to learn ANTLR and have both the 2007 book “The Definitive ANTLR Reference” and ANTLRWorks (an interactive tool for creating grammars). And, being that sort of person, I started at Chapter 3. (“A quick tour for the impatient”).

It’s a fairly painful process especially as some errors are rather impenetrable (e.g. ANTLR: "missing attribute access on rule scope" problem which just means to me “you got something wrong”). Also I have some very simple grammars (3-4 productions only) and simple input (2 lines) which when run give “OutOfMemory” error.

The ANTLR site is useful but somewhat fragmented and some SO users have commented (https://stackoverflow.com/questions/278480/good-tutorial-for-antlr) that the book and the tutorials expect a high entry level. I’ve been reluctant to approach the ANTLR discussion list because of this.

LATER We are beginning to get to grips with it. It would be useful to have simple reliable examples that could be gently expanded. It’s certainly worth mastering as we have remodelled quite a lot of our thinking based on ANTLR.

One problem is that ANTLR V3 has signifcant changes from V2. One answer on SO (and on the ANTLR pages) refered to a V2 syntax that is no longer available.

Some of the ANTLR questions on SO have helped me a lot, but finding them is a bit ad hoc. So I’d like to know how SO users can help to make the learning process less painful. (If you refer to the reference book it would be useful to point to particular pages).

EDIT. @duffymo and @JamesAnderson have confirmed that ANTLR is hard work – largely because parsers are difficult. (FWIW I have been through LEX/YACC, etc. and there’s no doubt that ANTLR is more powerful and easier to work with.) I think it would still be useful to have areas where it’s possible to avoid fouling up such as:

  • ensure correct capitalisation of variable names
  • add package name to lexer as well as parser
  • take care over order of rules as it affects precedence

and more of these sort would be useful.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:39:24+00:00Added an answer on May 12, 2026 at 7:39 pm

    I agree – ANTLR is not for the faint of heart. It does expect a high entry level, because grammars and parsers are not trivial.

    With that said, here are a few suggestions:

    1. Forget about v2. Version 3 is the standard; don’t even waste time considering the earlier version or its documentation.
    2. OutOfMemoryError is telling you that there’s something circular in the grammar you’ve defined.
    3. IntelliJ has a wonderful IDE for working with ANTLR v3. It’ll give you a graphical representation of your grammar, step-through debugging, etc. If you’re going to be doing a lot of work with ANTLR it’d be worth a few dollars to buy a license.

    ANTLR won’t be easy to master. The book is good, but dense. The error messages are cryptic, as you’ve noted. I’d be surprised if anyone here could make it easy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have started to learn symfony framework by reading joobet-propel book.i was in URL
I have just started to learn ASP.NET MVC 3 form this book and I
I have started to learn how to use OOP and have created a user
I have started to learn about python and is currently reading through a script
greetings, today i have started to learn java using netbeans ide. i would like
I have just started to learn how to code iOS apps. I have made
I have recently started to learn Objective-C and write my tests using OCUnit that
I am building an app to learn Django and have started with a Contact
Hello I'm very new to OpenGlES and i have started to try to learn
I started to learn PHP and have to find a mistake (maybe in this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.