Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unique flags in generated ecore model file
Unique flags in generated ecore model file [message #731030] Thu, 29 September 2011 18:21 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
hi,

i am working on a integration of a xtext editor with gmf. i generate the ecore model and load it in the gmfmap file. when i try to "create generator model" an error occurs while validation:
"All references are unique in EMF due to the current code generation"

i replaced all occurences of unique="false" with unique="true". then the validation succeed and i can generate the gmf editor and run it.

is that practice okay or will that cause errors?
how can i force that the unique flags are set properly during the ecore generation?


is this error caused by inherited classes? i use some of these pattern in my xtext grammar:


SuperClass:
 ClassA
|ClassB
;

ClassA:
(operations+=Operation)*
;

ClassB:
(operations+=Operation)*
;

Operation:
...
;


Re: Unique flags in generated ecore model file [message #731047 is a reply to message #731030] Thu, 29 September 2011 18:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

which is the reference that is not unique?
having a look at org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo sourcecode ereferences should be unique=true

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unique flags in generated ecore model file [message #731060 is a reply to message #731047] Thu, 29 September 2011 19:58 Go to previous messageGo to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
first thing i should mention: the error "All references are unique in EMF due to the current code generation" is located at the gmfgen file (showed in problems view, no location given).

Quote:
which is the reference that is not unique?

whenever the unique flag is generated into the file, it has the value "false". it seems that all ereferences and eattributes with the same cross reference target are set to unique=false.

the references are multiple, are no containments and reference to an EClass. here is some portion of the ecore model and the corresponding grammar:
    <eStructuralFeatures xsi:type="ecore:EReference" name="inputs" unique="false"
        upperBound="-1" eType="ecore:EClass platform:/resource/de.upb.swt.xkaos/src-gen/de/upb/swt/xkaos/Xkaos.ecore#//Object"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="outputs" unique="false"
        upperBound="-1" eType="ecore:EClass platform:/resource/de.upb.swt.xkaos/src-gen/de/upb/swt/xkaos/Xkaos.ecore#//Object"/>


Operation:
	'Operation' name=ID '{' 
		'Input' inputs+=[Object] (',' inputs+=[Object])* ';' 
		'Output' outputs+=[Object] (',' outputs+=[Object])* ';'
[...]
	'}'
;

Object:
[...]
;
Re: Unique flags in generated ecore model file [message #731070 is a reply to message #731060] Thu, 29 September 2011 20:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

it makes sense to me that those crossreferences are marked as not unique. why does GMF have a problem with this?
maybe youll get an answer in the GMF group/forum.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 29 September 2011 20:40]

Report message to a moderator

Previous Topic:[Xtext formatting] Ignore indentation in special cases and how to disable autowrap
Next Topic:unit tests in the presence of imported packages
Goto Forum:
  


Current Time: Wed Apr 24 14:48:21 GMT 2024

Powered by FUDForum. Page generated in 0.02692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top