Skip to main content



      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 04:34 Go to next message
Eclipse UserFriend
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?
Re: How to split Xtext model file [message #1794067 is a reply to message #1794066] Thu, 23 August 2018 04:35 Go to previous messageGo to next message
Eclipse UserFriend
this is not a xtext feature
Re: How to split Xtext model file [message #1794068 is a reply to message #1794067] Thu, 23 August 2018 04:40 Go to previous messageGo to next message
Eclipse UserFriend
Dear Christian,
Thanks for your quickly reply!
Is there any kind of model split document for xtext?
Re: How to split Xtext model file [message #1794069 is a reply to message #1794068] Thu, 23 August 2018 04:44 Go to previous messageGo to next message
Eclipse UserFriend
no you need to basically support composition in your dsl e.g. by use cross references. there is no GENERIC split.
Re: How to split Xtext model file [message #1794071 is a reply to message #1794068] Thu, 23 August 2018 04:53 Go to previous messageGo to next message
Eclipse UserFriend
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 05:44 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: How to split Xtext model file [message #1794120 is a reply to message #1794071] Thu, 23 August 2018 20:55 Go to previous message
Eclipse UserFriend
Hi, Ed Willink
Thanks for your reply.
The "Control" action i learned from the book <<EMF Eclipse Modeling Framework>>, 2nd Edition, Chapter 13.8

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


Current Time: Tue Jun 24 10:38:47 EDT 2025

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

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

Back to the top