Change:

(COMMA! array_data)?

To:

(COMMA! array_data)*

Jim

> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of Brian Krahmer
> Sent: Monday, November 30, 2009 2:05 PM
> To: [email protected]
> Subject: [antlr-interest] Please help with grammar tweak
> 
> Hello,
>   I have a small issue with a grammar file, and really don't know what
> I'm doing.  :)  Can anyone help me please?
> 
> Applicable part of my grammar:
> 
> const_array : lb:LBRACK list_array_data RBRACK! ;
> list_array_data : array_data (COMMA! array_data)? ;
> array_data  : atom  |  (STRING1 | STRING2) ARROW^ atom ;
> 
> "foo = [1, 2];" works.  However, I need to be able to have 1..n
> array_data elements, such as "foo = [1, 2, 3, 4];"
> 
> I'm sure this is probably a small tweak, but I'm not sure how to fix
> it.  Thanks in advance!
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address




List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--

You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.


Reply via email to