I need to support wild cards of the form:
a) a*pp?e
b) *pple
c) a?p*
d) appl?
I've worked it out to be:
WILD_STRING: (('a'..'z'|'A'..'Z')* ('*'|'?') ('a'..'z'|'A'..'Z')*)+
This generates the warning "Decision can match input
('a'..'z'|'A'..'Z') using multiple alternatives 1,2 disabling
alternative(s) 2." When compiled, it seems to "work" even with the
warning. I *think* I understand that the ambiguity arises from the
fact that after ('*'|'?') has matched, either one of the char patterns
might be selected. With all my test input it appears to work fine.
I'm wondering if there's an unambiguous way to encode such a pattern
though?
Thanks,
--tim
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/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
-~----------~----~----~----~------~----~------~--~---