Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Nested EPackage in ECore model cannot be imported in XText
Nested EPackage in ECore model cannot be imported in XText [message #869356] Thu, 03 May 2012 09:26 Go to next message
Charles Bonneau is currently offline Charles BonneauFriend
Messages: 32
Registered: February 2010
Location: Belgium
Member
Hello,
I'm trying to define a grammar based on several ECore models.

Those models contains nested packages :
 - platform:/resource/model.ecore
    - rootPack
       - some EClasses
       - subPack
          - some Classes

If I'm trying to import thoses models using this way :
import 'platform:/resource/model.ecore'

In my XText grammar, I cannot acces the classes located in the sub Package, only the classes which are defined in the root package are available.

The only way I managed to work this out, is to install my models (and generated plugins) in the workbench and reference the package using their NS_URI.
import 'www.url.org/rootPack'
import 'www.url.org/rootPack/subPack' as subPack

But this way I have classpath issues. And moreover, this is not acceptable beacause I would like to be able to work on my models in the same workspace in which the Xtext project is located.

Any advice on how to accheive that ?



Kind regards,

Charles
Re: Nested EPackage in ECore model cannot be imported in XText [message #869623 is a reply to message #869356] Thu, 03 May 2012 18:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13657
Registered: July 2009
Senior Member
Hi,

in general the use of nested epackages is discouraged. same is for the
use of platform:/resource uris - they are deprecated. never the less
something like the folloing should work: import
"platform:/resource/org.xtext.example.mydsl/src/org/xtext/example/mydsl/My.ecore#//subpackage"


~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Nested EPackage in ECore model cannot be imported in XText [message #870188 is a reply to message #869623] Mon, 07 May 2012 08:14 Go to previous message
Charles Bonneau is currently offline Charles BonneauFriend
Messages: 32
Registered: February 2010
Location: Belgium
Member
Hi,
Thank you very much, your answer was very usefull.

I will take your advice into account, but I don't have the ownership of the metamodel.

Regards,

Charles Bonneau
Previous Topic:some newbie questions...
Next Topic:Copying folders
Goto Forum:
  


Current Time: Tue Nov 24 18:53:50 GMT 2020

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

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

Back to the top