Run xtext workflow from another plugin project [message #989897] |
Sun, 09 December 2012 11:53  |
Eclipse User |
|
|
|
hello all ,
I searched about how i can run xtext workflow from another plugin project but I did not find a complete explanation for the process
I have the grammar.xtext file and the workflow file (generator.mwe2) and I created a class to run the generator programmatically using this code
Injector inj = new Mwe2StandaloneSetup().createInjectorAndDoEMFRegistration();
Mwe2Runner runner = inj.getInstance(Mwe2Runner.class);
runner.run("org.eclipse.xtext.example.tutorial.GenerateTutorial", new HashMap<String, String>());
this code work fine from within xtext Project , but does not from another plugin or java project .
any help or reference to website to read about
thanks in advance
adnan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Run xtext workflow from another plugin project [message #1006524 is a reply to message #1006325] |
Thu, 31 January 2013 10:05  |
Eclipse User |
|
|
|
Hi Christian
Thanks for your helpful response, the problem seems to be much clear now after reading that bug report.
Here is the top view of what we are trying to do:
1. Read a model & its metamodel (.xmi, .ecore files) and generate
text files that represent the model and metamodel in a different
language : this is done using xpand
2. Generate grammar file (.xtext) for parsing these files:
again using xpand
3. Run an xtext workflow (.mwe2) for generating language artifacts
for the grammar file generated in step 2.
[4. Use the other language to analyse and transform the model
generated in step 1.]
5. Load the transformed model files using the Xtext-based environment
generated in step 3.
6. Serialize the model to create new .xmi files.
To automate all these steps, an Eclipse plugin with context menu contribution was created. The user clicks on any model (.xmi)
file to invoke the entire process for that file.
However, we keep getting errors in the (3rd) step that requires running
of the Xtext workflow to initialize a language whose's grammar had been generated based on the model selected by the user (this is the dynamic part here).
Please let us know if you have any suggestions how to avoid the reported
errors.
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.30377 seconds