Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Multiple versions of a grammar in parallel
Multiple versions of a grammar in parallel [message #1760000] Fri, 21 April 2017 02:46 Go to next message
Eclipse UserFriend
Hi xtext community,

does anybody know a concept how to run different versions of a grammar in parallel?
We have a version identifier in our grammar (like Version 2.5) in order differ between all published grammar versions. However it is only possible to install one eclipse plugin (for the latest version usually) and our customers have different versions of the grammar in use (each project may use a separate grammar version).
I know that I can add backwards compatibility to the grammar and the code, but we do not want to maintain this stuff and get rid of it. Is there any way to handle this except of providing some backwards compatibility with the latest grammar version?

Many thanks for your ideas and opinions.

Best regards,
Kevin
Re: Multiple versions of a grammar in parallel [message #1760005 is a reply to message #1760000] Fri, 21 April 2017 03:09 Go to previous messageGo to next message
Eclipse UserFriend
well there are multiple thinks of this.

(a) you can't install multiple versions of the same plugin, you can install multiple plugins only => no simple update mechanism
(b) xtext supports content type based language differentiations by some adoptions of plugin.xml (and maybe other places)
e.g. org.eclipse.xtext.content_resourceServiceProvider instead of org.eclipse.xtext.extension_resourceServiceProvider,
register editor based on content type instead of file extension
i dont know of any documentation or tutorials on this nor have a ever don this myself
and i dont know if this runs properly with all features you use and need.
(c) xtext 2.11 has the option to switch parser entry rule from outside, maybe you can leverage this from your usecase as well (e.g. adoption XtextResourceFactory)
(d) just have one grammar/parser and do the distinction there somehow (dont know where the version idenitifer is at your code)

=> you need to find a way to mitigate the usability flaws of (a) and have a look if you can get (b) running
Re: Multiple versions of a grammar in parallel [message #1760028 is a reply to message #1760005] Fri, 21 April 2017 06:32 Go to previous message
Eclipse UserFriend
Hi

If your multiple grammar versions represent a largely compatible evolution (such as you observe with Java) you probably do not want multiple grammars. Your users will find it more helpful to have a single grammar that warns when facilities not available with the selected version are in use.

If your multiple grammar versions are seriously incompatible, you probably want independent plugins and perhaps a little content-type cleverness to allow the same extension to be used by multiple versions.

Regards

Ed Willink
Previous Topic:Active Annotation Concept in a XBase and JvmModel based DSL
Next Topic:Launch Runtime Eclipse run configuration unreliable?
Goto Forum:
  


Current Time: Thu May 15 21:56:19 EDT 2025

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

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

Back to the top