On Wed, Sep 3, 2008 at 7:36 PM, Bill Mayfield <[EMAIL PROTECTED]> wrote:
> Okay... but what if this isn't a lexer problem? Suppose I my input is
> only made up of 'o' and 'k'
>
> oooookooookkooo -> 1 match
> oookkoooookkoook -> 2 matches
>
> what would my grammar look like?
>
> grammar test;
>
> start   :       chaos* pattern* chaos*;
>
> pattern :       T1 T2 T2 T1;
>
> chaos   :       T1 | T2;
>
> T1      :       'o';
> T2      :       'k';
>
>
> This one compains that it can match multiple alternatives.
Posting the actual warning given is generally a good idea.
> I don't understand since I read it like: match any iteration of T1 or T2
> tokens followed by T1 T2 T2 T1 followed by any iteration of T1 or T2
> tokens....
>
Yes, but assuming you want the T1 T2 T2 T1 to match as a pattern
rather than a sequence of chaos's would lead to problems in other
cases so ANTLR is warning you either could match and thus it will
disable one of the alternates. I think it will automatically choose
pattern rather than chaos in which case you can ignore the warning as
it is doing what you want.

Tom.
>
> Thanks again :o)
>
>
> Kind regards,
> Bill
>

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to