[antlr-interest] Match A with exception of B .....how do I do that?

Vlastimil Adamovsky vlas01 at yahoo.com
Sun Feb 22 17:51:40 PST 2009


My weekend was a sleepless one. I have a problem and I hope ANTLR experts will help me....
 
Assume, I have defined lexer rules:
 
A  :   '0' .. '9' ;
 
B  :   '4' .. '7';
 
I want to parse digits, that are from 0 to 9  except those that are from 4 to 7.
In reality, I want to parse only digits  0,1,2,3,8,9 ....
 
How do I set up a correct rule? 
 
Please HELP!
 
Thanks,
  Vlastimil 
 http://ironglue.wordpress.com
 
 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090222/e2dc1266/attachment.html 


More information about the antlr-interest mailing list