Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Semantic model not resolvable by xtext-grammar
Semantic model not resolvable by xtext-grammar [message #904384] Tue, 28 August 2012 10:59 Go to next message
Florian Pirchner is currently offline Florian Pirchner
Messages: 87
Registered: July 2009
Member

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 Go to previous messageGo to next message
Florian Pirchner is currently offline Florian Pirchner
Messages: 87
Registered: July 2009
Member

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 #904570 is a reply to message #904387] Tue, 28 August 2012 17:46 Go to previous messageGo to next message
Florian Pirchner is currently offline Florian Pirchner
Messages: 87
Registered: July 2009
Member

Hint from cristiano did the trick:

import "platform:/resource/org.lunifera.metamodel.entity/model/Entity.ecore"


seems to work. Getting a warning that the resource is not in class path, but it should be there. And the generator is working. So i think that was the solution...

Thanks,
Florian

[Updated on: Tue, 28 August 2012 17:46]

Report message to a moderator

Re: Semantic model not resolvable by xtext-grammar [message #904943 is a reply to message #904570] Wed, 29 August 2012 12:32 Go to previous message
Florian Pirchner is currently offline Florian Pirchner
Messages: 87
Registered: July 2009
Member

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.
Previous Topic:EMF Model Update Strategy
Next Topic:Debugging Xtext
Goto Forum:
  


Current Time: Fri Oct 24 07:23:52 GMT 2014

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

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