textgen and generator in one language

Hello forum!

I have a language with 2 root mapping rules (to xml) in the generator aspect. Then I defined a generator aspect, which outputes a CSharp source file. The problem is that this source file is never generated. So I've created this a language which holds a reference to the other language and outputs the text.

I read this thread here:

So I'm asking if there's another solution or do I have to use this workaround?

1 comment
Comment actions Permalink
Hi msch95,

I've never tried the solution suggested in the thread you read. I use a different workaround (thx to Markus Völter) which includes two steps:

  1. Add an additional generator which has the highest priority of all your generators. Add a preprocessing script (which modifies the model) to this generator. Programmatically clone the input roots and insert an artificial property like...
    inputRootClone/.setProperty("generator", "xy")
    and add it to the original input model.
  2. Modify the remaining generators to make sure that only the responsible generator consumes the provided root node (indicated through the artificial property).

That's it.


Please sign in to leave a comment.