[antlr-interest] question about nondeterminism

cj_daly cj_daly at yahoo.com
Sat Feb 28 03:20:18 PST 2004


I've got antlr 2.7.2.  Can anyone explain why the following grammar
gives nondeterminism warnings?  I would think that with enough
lookahead there should should be no ambiguity, but maybe I am
misunderstanding "nondeterminism".

Is this ignorable?

Without refactoring the rules is there some way (options?) to make the
warning go away?  (I know I could pull the ("A")? up into the test
rule before the foo|bar alternative but I'm trying to avoid that.)

below is the grammar:

////
class TestParser extends Parser;

options { k=2; }

test : foo | bar;

foo : ("A")? "X";
bar : ("A")? "Y";




 
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