[antlr-interest] Resolving nondeterminism

Braden McDaniel braden at endoframe.com
Tue Jun 22 06:44:08 PDT 2004


Given:

        class TestParser extends Parser;
        
        foo
            :   attribute
            |   operation
            ;
        
        attribute
            :   scopedId ID
            ;
        
        operation
            :   ("oneway")? scopedId ID LPAREN RPAREN
            ;
        
        scopedId
            :   ("::")? ID ("::" ID)*
            ;

Because of the nature of scopedId's definition, antlr complains of
nondeterminism between foo's alternatives for any value of k. I'm just
wondering if there are any clever tricks to resolve this without
mangling the productions too badly for the human reader.

-- 
Braden McDaniel                           e-mail: <braden at endoframe.com>
<http://endoframe.com>                    Jabber: <braden at jabber.org>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list