Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Configurable generator
Configurable generator [message #1844375] Sat, 11 September 2021 16:16 Go to next message
Yannick DAVELUY is currently offline Yannick DAVELUYFriend
Messages: 28
Registered: July 2020
Junior Member

I have a DSL and I want to use different code generators.
In the DSL project configuration I would like to add a combo with the list of available generators registered by plugin extension.

Each generator comes with :
- the code generator itself
- additional validation rules
- a specialized content assist
- a specialized quickfix
- a specialized derived state computer
- specific code templates
- ...

Here is my approach :
For each generator create a specific injector with bindings for code generator, validator, content assist, ...

In my Dsl, create an helper that get the injector from the project configuration (combo).
In my Dsl generator, validator, content assist, quickfix, ... get the injector from the helper, instantiate the delegator and call it.

Is it a good approach ?

Is there existing code I can inspire from ?


Re: Configurable generator [message #1844424 is a reply to message #1844375] Mon, 13 September 2021 15:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14111
Registered: July 2009
Senior Member
I'd go for one injector and read preferences at the points where you want to do different things.

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Re: Configurable generator [message #1848885 is a reply to message #1844375] Wed, 22 December 2021 10:48 Go to previous message
Sally Mayor is currently offline Sally MayorFriend
Messages: 2
Registered: June 2021
Junior Member
It seems that your approach is correct, but I recommend you follow all the innovations. Every day scientists invent something new, and maybe you can buy something more economical. I will try to find out about all the discoveries as soon as possible. Recently I was looking at modern Diggers & Excavators and was surprised. Heavy equipment has taken things to a new level. Even a small machine can do a colossal amount of work. What's more, even a schoolboy can understand how to operate the latest devices.

[Updated on: Thu, 23 December 2021 10:26]

Report message to a moderator

Previous Topic:XText project migrating from Eclipse to LSP : No ContentAssist working
Next Topic:How can I transform an xtext dsl file to xml?
Goto Forum:

Current Time: Thu Jan 20 23:20:21 GMT 2022

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

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

Back to the top