Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Maintaining xtext model backwards compatibility
Maintaining xtext model backwards compatibility [message #1711430] Fri, 16 October 2015 00:28 Go to next message
Alex Mil is currently offline Alex MilFriend
Messages: 5
Registered: October 2015
Junior Member
Hi,

we are in a situation where we need to make changes to our xtext model that are mostly keyword changes. The issue we are having is that we have customers that are on an older version so we are trying to come up with a tool that will convert the older version to the new one.

The changes we are making are mostly keyword changes, I'll try and explain:

Version 1.0


IntegerRestriction:
	'range' '[' (min=INT) ':' (max=INT) ']' ';'
;


Version 2.0

IntegerRestriction:
	'integer' 'range' '[' (min=INT) ':' (max=INT) ']' ';'
;


Once we upgrade to version 2.0, we want to upgrade our existing customer instances (of version 1.0) to the new version.

This is a simple example just to explain my point, in reality our model is much bigger and more complex so "manual" changes are out of the question.

We have looked into a process to build a tool that will load the 1.0 instance and slightly change the serialisation so that it outputs the model with the new keywords

All our changes are additional keywords. However, the serialisation that outputs the keywords does not seem to be accessible to us (at least not easily and not without a feeling we are doing something horribly wrong Smile).


So I guess in the end my question is - is there a better way (or A way Smile) of doing this and how?

Thanks!


Thanks!


Re: Maintaining xtext model backwards compatibility [message #1711556 is a reply to message #1711430] Sat, 17 October 2015 07:12 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
So your changes are keywords etc. which is "boilerplate code".
Would an additional generator section in version 1.0 which generates version 2.0 syntax be an option?
Re: Maintaining xtext model backwards compatibility [message #1711645 is a reply to message #1711556] Sun, 18 October 2015 23:44 Go to previous message
Alex Mil is currently offline Alex MilFriend
Messages: 5
Registered: October 2015
Junior Member
Thanks for your reply.

We've found a way of doing this - creating a tool based on a "intermediate" model which has all the new keywords from the new model but they are optional.

Then we've implemented the SyntacticSequencer to always output these optional keywords.

By doing this, we can load the old model without the extra keywords and then output a model instance compatible with the latest model (since it will have the new keywords).


Thanks!
Previous Topic:add certain files to global scope
Next Topic:[Xtext] Formatter (nextGen): Disable autowrap
Goto Forum:
  


Current Time: Fri Apr 19 19:40:14 GMT 2024

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

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

Back to the top