|
Re: Synchronizing Sirius with Xtext [message #1829063 is a reply to message #1829054] |
Wed, 24 June 2020 13:25 |
|
Hi,
There are different ways in which Sirius and Xtext can be intergrated, but from what I understand you want to use Sirius to display and edit Xtext-based models.
The basic idea is simply to use Sirius "normally", and define your diagrams on the Xtext-based models as if they were classical EMF models (which they mostly are).
You will have to know the names of the element types that you want to manipulate (from the Xtext grammar), but mostly, to Sirius, Xtext models are just EMF models which have a specific serialization.
Make sure you have the optional "Sirius Integration with Xtext" feature (id org.eclipse.sirius.runtime.ide.xtext) installed, which ensures Sirius does not mess with the Xtext serialization and formatting.
There *are* some subtelties when you go beyond the basics, and you may be interested in the whitepaper we published a few years ago (but which should still be valid) at https://www.obeodesigner.com/en/white-paper-xtext-sirius if you want to go further.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Synchronizing Sirius with Xtext [message #1829084 is a reply to message #1829068] |
Thu, 25 June 2020 00:45 |
Brandon Lewis Messages: 268 Registered: May 2012 |
Senior Member |
|
|
> If yes I cannot find the metamodel to link from Xtext since I have an ecore file only in the Sirius DSL, not in the one generated by Xtext.
I think you will want to use the same ecore model between Sirius and your Xtext.
You can create a Xtext project from an existing ecore model and have the ecore model be external to main xtext DSL project. That way Sirus and Xtext are working on the same ecore model.
When you create an Xtext project from an existing ecore model, it will suggest a grammar for you (it'll be very generic). You can change that grammar to fit your desired Xtext grammar.
If you've already done work in an existing Xtext project, this link mentions how to import and external ecore model:
http://blog.efftinge.de/2009/11/xtext-using-existing-ecore-models.html
[Updated on: Thu, 25 June 2020 00:58] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02741 seconds