Incompatible list features in Ecore [message #664704] |
Mon, 11 April 2011 16:13 |
James Williams Messages: 27 Registered: July 2009 |
Junior Member |
|
|
Hi there,
I'm trying to implement an Xtext version of Emfatic, but am coming across an issue that I'm not sure how to resolve, or whether it is even possible to...
A simplified version of my problem is below:
EClass:
( eAttributes+=EAttribute |
eOperations+=EOperation |
eReferences+=EReference )*
;
EAttribute:
name=ID
;
EOperation:
name=ID
;
EReference:
name=ID
;
I'm getting an error on the eAttributes and eReferences assignments (but not for eOperations):
It seems that the problem is caused by the eAttributes collection not having the appropriate methods that the '+=' operator looks for. I found a previous thread with a similar problem ( http://www.eclipse.org/forums/index.php?t=msg&goto=43269), where the solution was to change the 'list' assignment to a 'feature' assignment and have the rule return the required type.
In this case, this doesn't seem to be possible as I can't return ELists (or, at least, I don't know how to).
Interestingly, the problem doesn't exist for the eOperations list. Looking into the implementation, eAttributes and eReferences are BasicEList<T>s and eOperations is simply an EList<T>. I guess the BasicEList type is causing the problem here? (changing 'eOperations' to 'eAllOperations', which is a BasicEList, causes the same problem to arise).
Does anyone know how I might be able to work around this issue?
Many thanks in advance.
James
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03197 seconds