Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Configurable generator
Configurable generator [message #1844375] Sat, 11 September 2021 12:16 Go to next message
Eclipse UserFriend
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
Re: Configurable generator [message #1844424 is a reply to message #1844375] Mon, 13 September 2021 11:38 Go to previous message
Eclipse UserFriend
I'd go for one injector and read preferences at the points where you want to do different things.
Previous Topic:Expression Language Formatting and Quickfixes
Next Topic:Reference model elements from target platform
Goto Forum:
  


Current Time: Wed Jul 23 06:29:01 EDT 2025

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

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

Back to the top