Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EMF-IncQuery » Generating *.eiq code from IncQuery metamodel instances
Generating *.eiq code from IncQuery metamodel instances [message #1046079] Sun, 21 April 2013 10:03 Go to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
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 10:30]

Report message to a moderator

Re: Generating *.eiq code from IncQuery metamodel instances [message #1046120 is a reply to message #1046079] Sun, 21 April 2013 11:37 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 98
Registered: July 2009
Member
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 20:08 Go to previous messageGo to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
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 22:37 Go to previous message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
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 Oct 22 14:05:55 GMT 2014

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

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