Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » VIATRA » Queries against xtext-dsl(Can I use incQuery against my xtext-dsl?)
Queries against xtext-dsl [message #1726407] Sat, 12 March 2016 21:09 Go to next message
John Milligan is currently offline John MilliganFriend
Messages: 8
Registered: March 2016
Junior Member
I have a large xtext-dsl and I want to develop queries against it for analytical purposes. I can write queries importing the meta-model, but I can't run them in the query viewer. Is this possible? Thanks.
Re: Queries against xtext-dsl [message #1726559 is a reply to message #1726407] Mon, 14 March 2016 16:15 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
Well, in order to run them in the Query Explorer, you need to be able to load an instance model to run the queries and of course the language plugins of your DSL must be installed into the Eclipse where you do this (e.g. a runtime Eclipse).
You can try opening the instance model in the "Sample Reflective Model Editor" of EMF (right click on the file, "Open with...", "Other") and load the model into the Query Explorer with the magic green button (Load model). However, this may not work in some cases, in which case you can try the Reflective tree editor for Xtext models developed by Zoltan Ujhelyi, VIATRA co-lead: http://cubussapiens.hu/2012/02/reflective-tree-editor-for-xtext-based-languages/
If you can't get it to work with your Xtext version, we will see if we can help you out.
Re: Queries against xtext-dsl [message #1726704 is a reply to message #1726407] Tue, 15 March 2016 20:58 Go to previous messageGo to next message
John Milligan is currently offline John MilliganFriend
Messages: 8
Registered: March 2016
Junior Member
Thanks! Using the reflective tree editor I was able to run queries against my dsl.

However in my latest Eclipse (Mars 2 using Xtext 2.9.2) I cannot get the MWE file to recognize the reflective editor. I get the following error "A value of type 'hu.cubussapiens.xtext.reflectiveeditor.generator.ReflectiveXtextEditorFragment' can not be assigned to the feature org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.addFragment(org.eclipse.xtext.xtext.generator.IXtextGeneratorFragment)"

Any ideas? Thanks.
Re: Queries against xtext-dsl [message #1726738 is a reply to message #1726704] Tue, 15 March 2016 22:29 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi John,

the issue here is that Xtext 2.9 updated the internals of the MWE-based code generation (in order to remove some old dependencies), and the reflective editor was not upgraded to support that. I will try to look into the issue shortly; it shouldn't be too hard to provide a version that works with the new generator. I have opened https://github.com/ujhelyiz/xtext-reflective/issues/6 to track this issue.

Best regards,
Zoltán
Re: Queries against xtext-dsl [message #1726848 is a reply to message #1726738] Thu, 17 March 2016 01:23 Go to previous messageGo to next message
John Milligan is currently offline John MilliganFriend
Messages: 8
Registered: March 2016
Junior Member
Zoltan,

I appreciate your support on this and this quick explanation. I suspected that it might be something like that since the new mwe2 file that generated from Xtext was much smaller than the old one. I will monitor this fix and move to 2.9 at a later date.

Thanks again,
John
Re: Queries against xtext-dsl [message #1727092 is a reply to message #1726848] Fri, 18 March 2016 19:17 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi John,

I have looked at the new generator, and for me it seems the reflective editor is working as expected. I did the following steps:

0. I have checked out the Domain model example coming with Xtext.
1. I have added the reflective editor as an optional dependency (required to be on the classpath for the workflow).
2. I have added the generator to the workflow. See the github gist https://gist.github.com/ujhelyiz/ec26cb2c7fc8e4babf21 for details.
3. I made sure after the code generation finished the plugin.xml file was updated with the results from the code generator.

Can you check whether this work for you as well?

Thanks,
Zoltán
Previous Topic:install viatra
Next Topic:execute the demo
Goto Forum:
  


Current Time: Fri Apr 26 00:21:30 GMT 2024

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

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

Back to the top