[antlr-interest] resolving left-recursive rules

Dieter Frej dieter_frej at gmx.net
Thu May 18 06:53:29 PDT 2006


Hi everybody,

at the weekend I had to much time and started copying the Java grammar
from the Java language specification to antlr v3. Unfortunately, this
grammar contains a lot of left-recursive rules and antlr does not like
left-recursiveness.

An example is
EnumConstants:
EnumConstant
EnumConstants , EnumConstant

My question is now what is the best ways to solve such left-recursive
rules? antlrworks provides some automatic resolving, but I have no idea
if it is doing it the right why. Or with other words: I would like to
understand what it is doing ;-)

Thanks in advance

- Didi


More information about the antlr-interest mailing list