Skip to main content



      Home
Home » Archived » EMF-IncQuery » Generating *.eiq code from IncQuery metamodel instances
Generating *.eiq code from IncQuery metamodel instances [message #1046079] Sun, 21 April 2013 06:03 Go to next message
Eclipse UserFriend
Hello there again!

Before I ask my second question, I would like to congratulate you about the fine work you are doing here. I hope you will achieve your further goals, too.

So, back to my question: I was wondering, if there is way to generate a pattern model code (*.eiq) directly from a PatternLanguage.ecore instance, which has been filled with correct patterns and corresponding attributes to be used to query an EMF instance?

Thanks!

Emre

[Updated on: Sun, 21 April 2013 06:30] by Moderator

Re: Generating *.eiq code from IncQuery metamodel instances [message #1046120 is a reply to message #1046079] Sun, 21 April 2013 07:37 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

it should be quite straightforward to do this, simply creating an appropriate resource with an .eiq file extension and adding the pattern model as content.
You can see a code snippet that is similar in the last message of this thread: https://groups.google.com/forum/#!msg/incquery-users/umGNFRTyzSQ/2zL9CVwxUosJ

The following parts are important:
val resourceset = XmiModelUtil::prepareXtextResource // create appropriate resourceset
val pr = resourceset.createResource(URI::createFileURI("D:/test.eiq"))
val pm = ... // this is your prepared pattern model
pr.contents.add(pm);
pr.save(null)


Explanation: since we use Xtext for creating pattern models, if Xtext saves the model into a resource, the resulting file will be the textual representation.

Mind if I ask what your worklow is? If I understand correctly, you are creating patterns programatically, use this patterns to query the model and now you would like to save the queries into an .eiq file, probably to later allow code generation and the usage of generated matcher classes?
Re: Generating *.eiq code from IncQuery metamodel instances [message #1049399 is a reply to message #1046120] Thu, 25 April 2013 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks a lot for the response. That's what I thought to myself, too. But my question is changed a little bit and I would be very happy, if you could take a look at this:

https://groups.google.com/forum/?hl=en&fromgroups=#!topic/incquery-users/m0QSxs49-qw

Thanks!
Re: Generating *.eiq code from IncQuery metamodel instances [message #1049467 is a reply to message #1046120] Thu, 25 April 2013 18:37 Go to previous message
Eclipse UserFriend
Abel Hegedus wrote on Sun, 21 April 2013 07:37
Mind if I ask what your worklow is? If I understand correctly, you are creating patterns programatically, use this patterns to query the model and now you would like to save the queries into an .eiq file, probably to later allow code generation and the usage of generated matcher classes?


And yes, my approach is similar to that. Although that I don't need generated code immediately, the part how I can query EMF models using the defined patterns(in PatternLanguage.ecore) is missing.
Previous Topic:Special syntax for pattern activation on nullable features?
Next Topic:Running IncQuery transformation inside an Eclipse WorkspaceJob
Goto Forum:
  


Current Time: Wed Jul 23 15:35:48 EDT 2025

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

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

Back to the top