Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to split Xtext model file(model split)
How to split Xtext model file [message #1794066] Thu, 23 August 2018 08:34 Go to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi,
I want split my model. I found if i use xmi format file, it is easy to split the model and save them. But when i use xtext format file, it can't be split correctly.
My meta-model and dsl grammar is very simple:
index.php/fa/33700/0/
The model in Xtext editor, in EMF editor and split action on EMF Editor:
index.php/fa/33701/0/
After split:
index.php/fa/33702/0/
The result shows, there is a copy of part of original textural information in the new model file, but the original model file did not changed.

Is Xtext support this split function? or is xtext have some model split guide?


Best regards!

by Keep Mind Calm
Re: How to split Xtext model file [message #1794067 is a reply to message #1794066] Thu, 23 August 2018 08:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
this is not a xtext feature

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to split Xtext model file [message #1794068 is a reply to message #1794067] Thu, 23 August 2018 08:40 Go to previous messageGo to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Dear Christian,
Thanks for your quickly reply!
Is there any kind of model split document for xtext?


Best regards!

by Keep Mind Calm
Re: How to split Xtext model file [message #1794069 is a reply to message #1794068] Thu, 23 August 2018 08:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
no you need to basically support composition in your dsl e.g. by use cross references. there is no GENERIC split.

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to split Xtext model file [message #1794071 is a reply to message #1794068] Thu, 23 August 2018 08:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6112
Registered: July 2009
Senior Member
Hi

I have never used the "Control" action because I have never understood what it might do and because a couple of attempts to find documentation failed. What you do might be the intended functionality, but perhaps not.

What you want to do could work, since a restructuring of the underlying model should be recognized by the serializer to give the correct textual rendering. But only if the restructuring could be a plausible input in the first place.

You therefore need to ensure that your grammar supports redirection of a child production to a secondary file. Then you need to ensure that your underlying model edit converts to use the support for the redirection.

This almost certainly requires you to add support to your grammar and add a corresponding edit action. (Xtext could introduce a standard redirect to separate file syntax that everyone could use and then everyone could share the associated edit action.)

Regards

Ed Willink
Re: How to split Xtext model file [message #1794081 is a reply to message #1794069] Thu, 23 August 2018 09:44 Go to previous messageGo to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi, Christian
Followed your suggestion in page: https://www.eclipse.org/forums/index.php/m/1793243/. I was defined my grammar to support cross references in composition, and it works.

But my colleagues think that is a little complex, because it need at least two new types and change some relations of the original metamodel, and we need to refine our application codes upon the metamodel. So we tried to find a simple way, it looks impossible now.


Best regards!

by Keep Mind Calm
Re: How to split Xtext model file [message #1794120 is a reply to message #1794071] Fri, 24 August 2018 00:55 Go to previous message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi, Ed Willink
Thanks for your reply.
The "Control" action i learned from the book <<EMF Eclipse Modeling Framework>>, 2nd Edition, Chapter 13.8



Best regards!

by Keep Mind Calm
Previous Topic:ProposalProvider functionality at the web editor
Next Topic:Content proposal for grammar with syntactically similar rules
Goto Forum:
  


Current Time: Mon Nov 19 03:44:06 GMT 2018

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

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

Back to the top