[antlr-interest] Re: Regular expression "repetition"
Monty Zukowski
monty at codetransform.com
Mon May 17 13:05:15 PDT 2004
> Thanks jbb,
>
> This will probably do when the number of repetitions are low - but I
> am facing a problem with r{0,63} and I hope there is another way :-)
ANTLR doesn't support counting grammatically. You need to write
semantic predicates to do that. Take a look at the FAQ. It's probably
in there. Basically you use action code to set and increment a
counter.
>
>
> --- In antlr-interest at yahoogroups.com, jbb at a... wrote:
>> how about:
>>
>> r r ( r ( r ( r )? )? )?
>>
>> Hope this helps...
>> -jbb
>
> /Per
>
Monty Zukowski
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
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