import ecore model using nsURI [message #1063813] |
Fri, 14 June 2013 07:10  |
Eclipse User |
|
|
|
Hi,
I created an ecore model that has a package called library with nsURI
http://<someurl>
I have also a genmodel for this ecore model and generated the model code.
Next, I tried to create an xtext project based on the ecore model (wizard).
The wizard generates me an xtext where I also have the line
import "http://<someurl>" as library
I get the error message couldn't resolve reference to EPackage "http://<someurl>"
what am I missing? Shouldn't the wizard generate error-free code?
thanks,
ravasz roka
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: import ecore model using nsURI [message #1106007 is a reply to message #1105993] |
Tue, 10 September 2013 10:57   |
Eclipse User |
|
|
|
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 11:01] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29949 seconds