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: 36
Registered: July 2020

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 message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14423
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 :
Previous Topic:Expression Language Formatting and Quickfixes
Next Topic:Reference model elements from target platform
Goto Forum:

Current Time: Fri Jan 27 09:06:42 GMT 2023

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

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

Back to the top