Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Installing multiple versions of a DSL
Installing multiple versions of a DSL [message #998577] Thu, 10 January 2013 09:33 Go to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
Hi,

I wonder if there is a way to install and use multiple versions of a DSL developed with Xtext? I have a DSL that needs to evolve over time, and would like to be able to use different versions of the DSL in different projects in one Eclipse workspace. Each project would have a property stating the version of the DSL to use.

I did not find any reference on how this might be done.

Jos
Re: Installing multiple versions of a DSL [message #999239 is a reply to message #998577] Fri, 11 January 2013 16:05 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
This is an interesting question. I keep postponing to think about this, but the scenario of language evolution is very relevant indeed.
Some thoughts:
- At OSGi level we could have different versions of the plug-ins installed, provided none of the plug-ins is a singleton, which precludes using any extension points. Not great.
- Xtext recognizes languages by file extension. I don't think it would be easy to further influence the selection of a parser etc.

From an organizational point of view, the easist solution would be to evolve the grammar in a way that previous language versions are still accepted. It's then a matter of different validators to recognize stuff that's not legal in a given language version. That's basically what, e.g., JDT is doing. For a single language it is possible to even let the parser reject certain constructs that are not available in a given language version. But for a generated parser this is difficult.

Xtext could possibly help in this scenario if grammar rules could be attributed with a range of language versions where the given rule is legal.

Of course, evolving a language in this way works best when only new syntax is added. When syntax is changed in arbitrary ways, things can get messy.

A related issue is: can we actually hook syntactic validators into Xtext? How can we tell if a (legal) model was created correctly or using a syntax that is illegal wrt the given language version?

I wish I had better answers,
Stephan



Re: Installing multiple versions of a DSL [message #999243 is a reply to message #999239] Fri, 11 January 2013 16:18 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
Stephan,

Thanks for your thoughts about this issue. Of course the best way to evolve a language is to make sure the syntax is backwards compatible ans then use validators. I do think that most versions will follow that rule. But there will be moments that a bigger change is needed (not very often maybe), and I was wondering what could be done about this.

Jos
Re: Installing multiple versions of a DSL [message #999281 is a reply to message #999243] Fri, 11 January 2013 18:09 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2013-11-01 17:18, Jos Warmer wrote:
> Stephan,
>
> Thanks for your thoughts about this issue. Of course the best way to
> evolve a language is to make sure the syntax is backwards compatible ans
> then use validators. I do think that most versions will follow that
> rule. But there will be moments that a bigger change is needed (not
> very often maybe), and I was wondering what could be done about this.
>
> Jos
The other point to attack this is the binding between the URI and
parser. Naturally more expensive to open the file first to determine
which version of the language that should process it.

Should be doable though.

Regards
- henrik
Previous Topic:How to know where content assist is invoked?
Next Topic:single quotes in Xtext
Goto Forum:
  


Current Time: Wed Apr 24 15:12:22 GMT 2024

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

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

Back to the top