|
|
Re: Quoted Strings in Enums? [message #60831 is a reply to message #60523] |
Sat, 18 July 2009 10:34 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Miles,
it seems, that you are stumbling upon a bug in the genmodel, if I get
your post right.
I guess that enum literals are not escaped properly. Maybe you want to
double check this?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 18.07.2009 1:44 Uhr, schrieb Miles Parker:
>
> It looks like quoted strings aren't allowed in any kind of entity. To
> accomplish this using Rules or Enums I'm thinking I'd need to do some
> kind of customization with ValueConverters or something. And I'm
> thinking that that would be much easier to do taking a token value and
> providing a contrained set of values from there.. which begs another
> quesiton that I'll ask in a seperate thread. :)
>
> On 2009-07-17 16:16:32 -0700, Miles Parker <milesparker@gmail.com> said:
>
>>
>> I'm wanting to allow a quoted string to be used for an enum value.
>> This is because I want to provide some built-in attribute enums that
>> match the allowed values of STRING tokens for an analagous rule.
>> Generating something like that give's me:
>>
>> enum SomeEnum :
>> AN_OPTION = '\"An Option\"';
>>
>> AN_OPTION(0, "AN_OPTION", ""An Option"");
>>
>> Which is of course an error.
>>
>> Is this a bug, i.e. the generator isn't escaping properly, or if not
>> is there a way to accomplish this (that doesn't require too much
>> hacking)? I can find a way around this, so I'm just curious.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03404 seconds