Xtext Grammar based on an already existing ecore diagram [message #1020897] |
Tue, 19 March 2013 06:21 |
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 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
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
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.02766 seconds