Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [XText] problem in importing a metamodel.
[XText] problem in importing a metamodel. [message #46175] Fri, 29 May 2009 10:11 Go to next message
Mikai Yang is currently offline Mikai YangFriend
Messages: 149
Registered: July 2009
Senior Member
Hi,
When I use 'import' to import a package, the editor reports the metamodel cannot be resolved. Even though I have copied the metamodel in the same
directory as the grammar, the problem is still there. I do not know why? This may be related to 'classpath' setting, but I have no idea about how to
set class path. Moreover, I would like to import the multiple packages from this metamodel. What can I do about it?
Hints are higly appreaciated.
Cheers
Michael
Re: [XText] problem in importing a metamodel. [message #46268 is a reply to message #46175] Fri, 29 May 2009 12:07 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Michael,

please provide more information (code), so we can see what exactly you
did. I assume that you tried to reference the package via NS-URI.
You should use a platform:/resource URI.

Example:

import "platform:/resource/my.project/model/metamodel.ecore"

If you want to refer to an EPackage in the resource which is not the
first in the root of the resource, you'll have to add the fragment
additionally.

Hope that helps,
Sven


Michael schrieb:
> Hi,
> When I use 'import' to import a package, the editor reports the
> metamodel cannot be resolved. Even though I have copied the metamodel in
> the same directory as the grammar, the problem is still there. I do not
> know why? This may be related to 'classpath' setting, but I have no idea
> about how to set class path. Moreover, I would like to import the
> multiple packages from this metamodel. What can I do about it?
> Hints are higly appreaciated.
> Cheers
> Michael
Re: [XText] problem in importing a metamodel. [message #46355 is a reply to message #46268] Fri, 29 May 2009 12:32 Go to previous message
Mikai Yang is currently offline Mikai YangFriend
Messages: 149
Registered: July 2009
Senior Member
Sven Efftinge wrote:
> Hi Michael,
>
> please provide more information (code), so we can see what exactly you
> did. I assume that you tried to reference the package via NS-URI.
> You should use a platform:/resource URI.
>
> Example:
>
> import "platform:/resource/my.project/model/metamodel.ecore"
>
> If you want to refer to an EPackage in the resource which is not the
> first in the root of the resource, you'll have to add the fragment
> additionally.
>
> Hope that helps,
> Sven
>
>
> Michael schrieb:
>> Hi,
>> When I use 'import' to import a package, the editor reports the
>> metamodel cannot be resolved. Even though I have copied the metamodel
>> in the same directory as the grammar, the problem is still there. I do
>> not know why? This may be related to 'classpath' setting, but I have
>> no idea about how to set class path. Moreover, I would like to import
>> the multiple packages from this metamodel. What can I do about it?
>> Hints are higly appreaciated.
>> Cheers
>> Michael

Hi Sven:
Thanks for your kind help. Now the problem is gone. But now I want to import the packages in the ecore model.
I don't know how to do it. Can you give me quick example?
Cheers.
Michael.
Previous Topic:How to add checks to a grammar?
Next Topic:Cross reference items not available in .chk files
Goto Forum:
  


Current Time: Thu Dec 26 15:08:41 GMT 2024

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

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

Back to the top