[antlr-interest] ANTLR meta-syntax question

Brian Smith brian-l-smith at uiowa.edu
Sun May 12 21:29:46 PDT 2002


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/ 



More information about the antlr-interest mailing list