Configurable generator [message #1844375] |
Sat, 11 September 2021 16:16 |
Yannick DAVELUY Messages: 39 Registered: July 2020 |
Member |
|
|
Hello,
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 ?
Thanks
Yannick
|
|
|
|
Powered by
FUDForum. Page generated in 0.05560 seconds