multiple generators - Xtext2, xtend2 [message #759945] |
Wed, 30 November 2011 11:25  |
Eclipse User |
|
|
|
Hello,
I'm using Xtext 2.0.1 and so Xtend2 for code generation.
How can I execute multiple different generators?
I mean more than one xtend2 class that implements the IGenerator interface (as the one that is created automatically in the generator package of the project)
I do not fully understand the relation between the workflow file and Main.java (again, in the generator package), and how I am supposed to modify them in order to run my multiple templates.
Main.java declares a single IGenerator that is instantiated magically somewhere with the default xtend2 class (file '<lang>Generator.xtend'). If I add another IGenerator member I can see (by debugging) that also this reference is instantiated magically, but with the same default class as the other one. How can I specify another class?
The workflow file '<lang>GeneratorMWE.mwe2' does not have any reference to any specific xtend2 class, so I do not know how to modify it (it only creates a generic org.eclipse.xtext.generator.GeneratorComponent)
I am sorry but as far as I can see the documentation describes the general syntax of MWE and xtend2, but does not show any example or explanation with respect to the files generated automatically by Xtext (ie the default Main.java and the workflow)
I hope this is somehow clear.
Thanks for any hint
|
|
|
|
|
Re: multiple generators - Xtext2, xtend2 [message #759962 is a reply to message #759954] |
Wed, 30 November 2011 13:01  |
Eclipse User |
|
|
|
Thanks, it works!
I figured out the required overriding even before reading your last post, but it is good to have a confirmation! and as a reference for others with the same problem.
Anyhow, this works as far as the workflow file is concerned, for the main it looks to me that I have to modify something more, but I'm going to double check
|
|
|
Powered by
FUDForum. Page generated in 0.03693 seconds