How to deal with optional commas? [message #667700] |
Sun, 01 May 2011 10:17  |
Eclipse User |
|
|
|
Hi,
I have a case where I want serialization to insert commas in a list, but
I want to accept missing commas in the grammar to be able to flag this
style as deprecated.
ListOfNames : names += STRING (','? names += STRING) ;
1. The deprecation warning I thought I would add in validation.
i.e. check if there is a nodemodel for ListOfNames. Where should
I look for the commas?
2. How do I make serialization emit a ',' when serializing the model?
Regards
- henrik
|
|
|
|
|
Re: How to deal with optional commas? [message #667845 is a reply to message #667812] |
Mon, 02 May 2011 08:28  |
Eclipse User |
|
|
|
Thanks Ed and Sebastian,
I tried Ed's tip and it worked fine.
Good to hear there is a better solution on its way - don't really like
to mix concerns - maybe annotations in the grammar would be a good idea
for things like this? (OTOH - it could make the grammar cluttered with
annotations for all sorts of concerns, which is just a different evil).
- henrik
On 5/2/11 12:23 PM, Sebastian Zarnekow wrote:
> Hi Henrik,
>
> Moritz is working on a new version of the serializer that will allow to
> customize that. So far Ed's suggestion should work.
>
> Regards,
> Sebastian
|
|
|
Powered by
FUDForum. Page generated in 0.07718 seconds