Re: Duplicate case error in generated model [message #461502] |
Sun, 02 August 2009 11:40 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi everybody,
the following Ecore model will lead to compile time errors.
eClass A {
attr X: int;
}
eClass B {
attr X: int;
}
eClass C extends A, B {
}
You'll end up with duplicate field names in the package. Is there a way
to avoid this?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 01.08.2009 11:22 Uhr, schrieb Sebastian Zarnekow:
> Hi KD,
>
> I guess, you are stumbling across a bug in EMF. It seems that the naming
> convention that is used by genmodel cannot handle this case. That's why
> I've added the EMF newsgroup to this thread.
> Maybe someone can confirm this to be a bug or give us a hint on how to
> avoid this compile time error.
>
> Regards,
> Sebastian
Am 01.08.2009 7:58 Uhr, schrieb KD:
>> The following grammar generates duplicate case errors in generated java
>> code.
>>
>> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>>
>> generate myDsl "http://www.xtext.org/example/MyDsl"
>>
>> Type:
>> 'B' (list+=B)* |
>> 'C' (list+=C)*
>> ;
>>
>> B:
>> A |
>> 'width' Width=INT
>> ;
>>
>> A:
>> 'name' name=STRING
>> ;
>>
>> C:
>> A |
>> 'width' Width=INT
>> ;
>>
>> Is it expected? The grammar itself is generated, so modifying the
>> grammar by hand is not possible. What other alternatives do I have?
>>
>> TIA.
>>
>> -- KD
>>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03685 seconds