|
|
|
|
|
|
|
|
|
|
|
|
|
Re: import ecore model using nsURI [message #1105970 is a reply to message #1105786] |
Tue, 10 September 2013 14:10 |
Mathieu MONTIN Messages: 26 Registered: October 2012 |
Junior Member |
|
|
Thank's for the link.
I've followed the post step by step. I've created the two projects and I've adapted their content to my case.
I've also added to those project the xtext nature (just in case). However, I still don't get any autocompletion and I can't save any file I modified with my EMF editor (it still looks like xtext is not able to serialize anything that does not belong to it in the first place).
Anyway, I've put a random print is the method "getLanguageName" in my runtime module and this method seems to be just ignored. It's like everything I've created is not even called.
In a way, it looks logical because we never really create links between what we build and the target dsl (in your case uml). The only link I've been able to spot is the one with the UMLEditor.
Have I missed something ? You do some weird changes in your workflow which I couldnt understand nor reproduce, and maybe this is why it failed.
What do you think ?
EDIT : now the method getLanguage is called, after some tweaks, but it still does not do what I was expected.
[Updated on: Tue, 10 September 2013 14:20] Report message to a moderator
|
|
|
|
Re: import ecore model using nsURI [message #1106007 is a reply to message #1105993] |
Tue, 10 September 2013 14:57 |
Mathieu MONTIN Messages: 26 Registered: October 2012 |
Junior Member |
|
|
sure !
(meanwhile, I keep trying with your example because I think this might be the answer).
I have a MM "A.ecore" which defines a class ICDEntry :
<eClassifiers xsi:type="ecore:EClass" name="ICDEntry">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
iD="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="features" eType="#//ICD/Features"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1"
eType="#//ICD/VariableType" defaultValueLiteral="INTEGER"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="min" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="max" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="dim1" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="dim2" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
</eClassifiers>
I have created an XText grammar in which there is a reference to an element of type "ICDEntry" like this :
VariableExpression returns AbstractExpression :
{VariableExpression} variable=[icd::ICDEntry]
;
But when I edit some files from that grammar, there is no autocompletion whatsoever. So I tried to edit those files with the classical EMF editor, and, after loading the proper resource, I am able to link an ICDEntry. However, when I try to save the file, it fails with and error, probably because xtext isnt able to serialize any element of type ICDEntry.
The post you link seems to fit my problem, but maybe those explanations will make you understand a bit more what kind of issue I am facing.
Anyway, thank's for you help and time.
EDIT : here is what I changed in my workflow :
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
// The following two lines can be removed, if Xbase is not used.
registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
registerGeneratedEPackage = "simulator.ICD.ICDPackage"
registerGenModelFile = "platform:/resource/org.sengs.simulator/model/simulator.genmodel"
}
[Updated on: Tue, 10 September 2013 15:01] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06622 seconds