Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 06:21 Go to next message
rohit ahuja is currently offline rohit ahuja
Messages: 27
Registered: February 2013
Junior Member
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 04:11 Go to previous message
Jan Koehnlein is currently offline Jan Koehnlein
Messages: 656
Registered: July 2009
Senior Member
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: Sat Oct 25 16:50:15 GMT 2014

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

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