[antlr-interest] ANTLR meta-syntax question

mzukowski at yci.com mzukowski at yci.com
Mon May 13 06:04:33 PDT 2002


ANTLR requires the parenthesis.  It makes it easier to associate actions
with the proper construct, e.g. inside or outside of the ()+ closure.

Monty

> -----Original Message-----
> From: Brian Smith [mailto:brian-l-smith at uiowa.edu]
> Sent: Sunday, May 12, 2002 9:30 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] ANTLR meta-syntax question
> 
> 
> I am new to ANTLR. I have found that it seems fairly 
> straightforward to 
> convert a BNF grammar to work with ANTLR. But, I am having trouble 
> understanding why ANTLR insists on me using parentheses when 
> they seem 
> redundant to me. For example, I have a rule:
> 
> A    :    B+;
> 
> I expect to match one or more B's. But, ANTLR complains 
> unless I rewrite 
> the rule as:
> 
> A    :   (B)+;
> 
> To me, the parentheses are not necessary. Am I doing 
> something wrong? Is 
> there a particular reason that ANTLR requires the 
> parentheses? I prefer 
> to use parentheses only for grouping.
> 
> Thanks,
> Brian
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> 
> 
> 

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list