[antlr-interest] Specifying limit on number of digits in the Grammar in ANTLR

Bharath R rbharath24 at yahoo.com
Thu Apr 26 04:25:05 PDT 2007


Hi,

      I'm a newbie to ANTLR. 
        I am trying to write a simple parser, that accepts number whose number of digits vary from 1 to 5. 

    Below is the ABNF format  ID: 1*5(DIGIT)
 DIGIT: '0'..'9'
 
 i.e the ID can be any number varying from a 1 digit number to a max of 5digit number. Each digit varying between 0 and 9.  
 How do I achieve this in ANTLR? I have been trying to write an equivalent EBNF format but without success. 
 Thanks for you help. 



Regards,
Bharath


       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070426/933e1069/attachment.html 


More information about the antlr-interest mailing list