[antlr-interest] Can subrules be set to 'n-to-m'?

Scott Stanchfield scott at javadude.com
Fri Mar 25 21:39:09 PST 2005


How is

  foo
    : (fee)+  (fie)*  (fo)+
    ;

More readable than

  foo
   : fee+  fie*  fo+ 
   ;

???

MAKE IT OPTIONAL!

If people feel the parens aid readability, they can type the damned things.
I'm sick of typing them when I shouldn't have to!

Never force *your* style on others like this. It's unnecessary and outright
self-important.

Read *my* comments -- it would be _more_ consistent to make them optional,
so they match how people use them in every regex language that people use...

-- Scott

> -----Original Message-----
> From: John D. Mitchell [mailto:johnm-advanced-java at non.net] 
> Sent: Friday, March 25, 2005 10:59 PM
> To: Scott Stanchfield
> Cc: 'antlr-interest Interest'
> Subject: RE: [antlr-interest] Can subrules be set to 'n-to-m'?
> 
> >>>>> "Scott" == Scott Stanchfield <scott at javadude.com> writes:
> [...]
> 
> > No no no no... Silly!
> 
> No, I understood you the first time.
> 
> Read the rest of the thread.  There are reasons for the + and 
> * and, as I've noted previously, the parens are important not 
> only for consistency but also for distinctiveness (i.e., readability).
> 
> Take care,
> 	John
> 





More information about the antlr-interest mailing list