[antlr-interest] Determinig the real ambiguities

Bogdanov, Serge serge.bogdanov at intel.com
Thu Jul 15 11:42:54 PDT 2004


>a_must_have_c : (A)? (B)+ C D | (B)+ D ;

How about 
	a_must_have_c : A (B)+ C D | (B)+ D;

>> Sergey Bogdanov
intel massachusetts
M/S HD2-246
77 Reed Road, 
Hudson, MA  01749
Tel: (978)553-2724

>-----Original Message-----
>From: thrutchy [mailto:eric_mahurin at yahoo.com]
>Sent: Thursday, July 15, 2004 2:30 PM
>To: antlr-interest at yahoogroups.com
>Subject: [antlr-interest] Determinig the real ambiguities
>
>Is there a way to turn off the ambiguities warnings that aren't real
>and only affection the parser prediction (and thus performance)?  Here
>is an example:
>
>a_must_have_c : (A)? (B)+ C D | (B)+ D ;
>
>It thinks these alternatives are ambiguous because they both can start
>with an indeterminate amount of B's, but the ambiguity is resolved
>right after that.
>
>I assume ANTLR will try matching the first alternative and then go to
>the second if the input matches the second alternative.  Is that
correct?
>
>I know that there are several ways I can turn off the warnings
>(syntactic predicate, options), but it would be nice if ANTLR could
>figure out that the alternatives really don't overlap even though it
>may predict the wrong alternative.  Eventually, it would be good to
>fix as many of these mispredictions as possible, but initially
>functionality is what matters.
>
>Eric
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>



 
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