Semantic model not resolvable by xtext-grammar [message #904384] |
Tue, 28 August 2012 10:59 |
|
Hi,
for my entity DSL i have extracted the semantic entity model (ecore) to a separated bundle.
org.lunifera.metamodel.dsl.entity (DSL bundle containing entity.xtext)
org.lunifera.metamodel.entity (containing entity.ecore, entity.genmodel)
My current problem is, that the xtext grammar can not resolve the entity model in IDE)
I put the entity.ecore and entity.genmodel inside a source folder.
grammar org.lunifera.metamodel.dsl.entity.Entity with org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations
import "http://www.lunifera.org/metamodel/entity/Entity"
import "http://www.eclipse.org/emf/2002/Ecore"
How can i achieve in IDE (not installed semantic model plugin - just in workspace) that the xtext grammar can resolve the ns_URI?
Thanks a lot in advance,
Florian
|
|
|
Re: Semantic model not resolvable by xtext-grammar [message #904387 is a reply to message #904384] |
Tue, 28 August 2012 11:03 |
|
Addition:
In GenerateEntity.mwe2 i specified following:
registerGenModelFile = "platform:/resource/org.lunifera.metamodel.entity/model/Entity.genmodel"
registerGeneratedEPackage = "org.lunifera.metamodel.entity.entitymodel.EntitymodelPackage"
May that be a problem?
Also interesting, that calling the GenerateEntity.mwe2 works fine without any problems.
|
|
|
|
Re: Semantic model not resolvable by xtext-grammar [message #904943 is a reply to message #904570] |
Wed, 29 August 2012 12:32 |
|
The solution above seems to have problems using tycho build! ;-(
BUT, i found two new solutions.
Given environment
bundle1:
org.lunifera.metamodel.dsl.entity -- Bundle containing the entity.xtext
Entity.xtext:
...
import "http://www.lunifera.org/metamodel/entity/Entity"
...
bundle2:
org.lunifera.metamodel.entity -- Bundle containing the entity.ecore and entity.genmodel
The problem is, that entity.xtext shows up errors, since the import can not be resolved.
Solution 1:
Convert org.lunifera.metamodel.entity to Xtext project. It seems that Xtext builder is publishing the ecore in the registery.
Solution 2 (not only for tycho):
Copy entity.ecore and entity.genmodel by maven build from org.lunifera.metamodel.entity/model to org.lunifera.metamodel.dsl.entity/target/model
Then the xtext-document can resolve the import.
|
|
|
Powered by
FUDForum. Page generated in 0.01948 seconds