0

I have created an xtext file where I have written a language for state machines. Now I want to create a graphical representation using Sirius. I watched a couple of tutorials online but they only show how to go from ecore to Sirius such as this one (https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial#Launch_a_new_runtime_from_your_Eclipse), but they do not show how to go from xtext defined language to sirius. I do not want to generate the ecore model from the xtext because a lot of constraints will be lost. Can you help me with that? Thank you!

MDE
  • 21
  • 1
  • To the best of my knowledge Sirius requires an Ecore model so you can't create an editor without one. Which kind of contraints are you talking about? Some can be embedded [right into your metamodel](https://wiki.eclipse.org/OCL/OCLinEcore) but you'll likely have to make them available to Sirius anyway. – Emmanuel Chebbi Jun 29 '20 at 15:45
  • @EmmanuelChebbi for example when I have a [1...* ] relationship, in xtext I write state+=state+, but when I generate the ecore model it shows as [0...* ] relationship, even though in xtext when I create a sample model it works fine, it requires you to define at least one state – MDE Jun 29 '20 at 16:09
  • Even if those constraints are not included within the generated EMF code you can still enforce them with the Sirius diagram editor, just like the Xtext textual editor enforce them. – Emmanuel Chebbi Jun 29 '20 at 18:23

0 Answers0