[antlr-interest] Newbie Ques: How to remove mutual left-recursion among rules

Sandeep Gupta sandy.pec at gmail.com
Thu Sep 7 02:31:58 PDT 2006


I apologize for the rules mentioned in the previous mail were wrongly
specified. The rules should have been

fragment choiceLists
    :    '(' contentParticle ( '|' contentParticle )+ ')'
    ;

fragment sequenceLists
    :    '(' contentParticle ( ',' contentParticle )* ')'
    ;

fragment contentParticle
    :    (name | choiceLists | sequenceLists) Qualifier?
    ;

I have tried using the algorithm quoted at
http://web.cs.wpi.edu/~kal/courses/compilers/images/PLTelralgorithm.gif but
to no avail. Can any one guide me how to remove such mutual left-recursions
and also how to handle the + and * qualifiers for it.

- Sandeep
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060907/a809a43c/attachment.html 


More information about the antlr-interest mailing list