I am currently trying to create a language that helps to create (otherwise repetitive) Informer/Listener setups. We have a custom middleware which I import in a runtime solution (see first screenshot).
The (yet simple) language itself allows to create a class sheet (-> generated into a Java classe) that can hold informers and listeners (-> generated into instantiated class variables of the type Listener and Informer provided by the runtime jar import).
Further there is an annotation that allows to define a function that is also added to the class.
The generation and all required referencing works perfectly fine.
However, I would like to allow the user to use participants (e.g. myInformer and myListener) within the inline code block (e.g. like the 'hw' above) and reference to them or use dot operations (e.g. an informer provides the method activate()):
I struggle with this as this is before generation, so there is no actual type of an informer/listener attached to the concepts. I think it can be solved by adding the correct type information to the informer and listener concept?
But then I also am not sure how (and where) I will have to influence the scoping so that 'myInformer' will appear in the BlockStatement?
I am aware that the mbeddr project similarly allows inline c code but unfortunately I could not identify how they do it.
Can someone point me in the correct direction on how to realize this?
Thanks in advance for any help!