[antlr-interest] Could antlr understand (group)3

Prashant Deva prashant.deva at gmail.com
Sat Sep 17 04:34:30 PDT 2005


No.

On 9/17/05, Vidar Håkestad <vidar at hawkis.com> wrote:
> Is it possible for antlr to understand a digit as a group operator in addition
> to *, ? and +? This would help in situations where a specific number of
> elements are known.
> For example in CSS, a color value may be specified with either three or six
> hex numbers. It would be shorter to write
> 
> HEX
>   : '0'..'9' | 'a'..'f' | 'A'..'F'
>   ;
> 
> COLOR
>   :  '#' ((HEX)3 | (HEX)6)
>   ;
> 
> instead of
> 
> COLOR
>   : '#' ((HEX HEX HEX) | (HEX HEX HEX HEX HEX HEX))
>   ;
> 
> Vidar
>


More information about the antlr-interest mailing list