Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Grammar based on an already existing ecore diagram
Xtext Grammar based on an already existing ecore diagram [message #1020897] Tue, 19 March 2013 02:21 Go to next message
Eclipse UserFriend
Hi All,

I am writing a Xtext grammar and need to mix the generated Ecore model and also import an existing Ecore model in the same grammar.

If i use the simple import "platform:/resource/....", in the xtext, it gives me an error because i have the old ecore under different directory(project), and the new xtext grammar is under a different directory(project).

I also searched and found, that i need to register this ecore and only then it can be used in the xtext. However, from the documentation of xtext, i tried couple of tricks, but it is not exactly working.

Can someone help me in using the existing ecore in the new xtext grammar?

Thanks,
Rohit Ahuja
Re: Xtext Grammar based on an already existing ecore diagram [message #1028295 is a reply to message #1020897] Thu, 28 March 2013 00:11 Go to previous message
Eclipse UserFriend
What error are you experiencing?

Make sure
1) The plug-in containaing the Ecore model and its generated classes is
on the classpath of your language's plug-in
2) You use the nsURI in the import
3) You register then generatedEcorePackage and the genModelFile in the
mwe2 workflow of your language in the StandaloneSetup section
4) You read the Xtext docs on using an imported Ecore model


Am 19.03.13 07:21, schrieb rohit ahuja:
> Hi All,
>
> I am writing a Xtext grammar and need to mix the generated Ecore model
> and also import an existing Ecore model in the same grammar.
>
> If i use the simple import "platform:/resource/....", in the xtext, it
> gives me an error because i have the old ecore under different
> directory(project), and the new xtext grammar is under a different
> directory(project).
>
> I also searched and found, that i need to register this ecore and only
> then it can be used in the xtext. However, from the documentation of
> xtext, i tried couple of tricks, but it is not exactly working.
>
> Can someone help me in using the existing ecore in the new xtext grammar?
>
> Thanks,
> Rohit Ahuja


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:ecore editor in video
Next Topic:Handling of boolean attributes while serialization
Goto Forum:
  


Current Time: Thu Jul 03 16:17:06 EDT 2025

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

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

Back to the top