[antlr-interest] Non-reserved keywords (again)

Monty Zukowski monty at codetransform.com
Wed Aug 10 07:44:07 PDT 2005


Olivier Dragon wrote:
> Greetings,
> 
> I have search long and far to see if anyone had had the same problem I'm
> having with a language that does not reserve keywords, like SQL and in
> my case Fortran. I have found many people with the problem, yet no
> useful solutions. The two main ones I found were
> 
> http://www.jguru.com/faq/view.jsp?EID=140
> and
> http://www.antlr.org/pipermail/antlr-interest/2002-June/001486.html
> 
> I have no idea how to execute the first one, that is create a custom
> token class and have ANTLR actually use it.

Search through the example code, there should be one that does this.  If
not, I know the C parser does.

You may also get some mileage out of my parser filter approach.  See
http://www.codetransform.com/filterexample.html

> And the second one completely breaks the parser, introducing fatal
> non-determinism which I am very reluctant to address.
> 
> Has anyone come up with a better solution? Does the latest ANTLR 3.0
> preview solve my problem? Will it?
> 

ANTLR 3 will be way easier dealing with unreserved keywords.  I doubt if
the latest preview is stable enough for real use yet.

Monty


More information about the antlr-interest mailing list