Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Using generator for corresponding xmi file, not just the xtextual
Using generator for corresponding xmi file, not just the xtextual [message #912118] Wed, 12 September 2012 20:52 Go to next message
Eclipse UserFriend
Hi,

I have a model for which I have both a graphical editor and an xtextual
(<-- textual with xtext :-) one. Although the model is the same, they of
course have distinct file extension (emodel and xmodel), since one is
xmi and the other xtext. Now I would like to run the code generator on
both xmodel and emodel files when they changed, not just xmodel files
(which works out of the box). Do I have to create a module for the
emodel type, with a resource service etc. or is there a quick way of
getting the builder to handle xmodel and emodel extensions in the same way?

Hallvard
Re: Using generator for corresponding xmi file, not just the xtextual [message #913158 is a reply to message #912118] Fri, 14 September 2012 18:05 Go to previous message
Eclipse UserFriend
Sigh, I gave up. In general it is possible and often desirable to run
the same generator on both the xmi and xtext versions of a model. But if
the generator relies on xbase and the jvm inference mechanism, it seems
difficult, since the jvm inference is triggered when getting the content
from the XtextResource (actually XbaseResource), and not the XMIResource.

If you use the jvm model and/or xbase and want to use linking, type and
jvm model inferencing etc, I have the feeling you'll need to have an
XtextResource, so serializing the xmi version to text and parsing it is
one option.

It would be nice to get a comment from the xtext developers about this.

Hallvard

On 12.09.12 17.52, Hallvard Trætteberg wrote:
>
> I have a model for which I have both a graphical editor and an xtextual
> (<-- textual with xtext :-) one. Although the model is the same, they of
> course have distinct file extension (emodel and xmodel), since one is
> xmi and the other xtext. Now I would like to run the code generator on
> both xmodel and emodel files when they changed, not just xmodel files
> (which works out of the box). Do I have to create a module for the
> emodel type, with a resource service etc. or is there a quick way of
> getting the builder to handle xmodel and emodel extensions in the same way?
>
> Hallvard
Previous Topic:How can I perform a ISemanticModification quickfix with formatting?
Next Topic:How to modify text in DSL editor (from code)?
Goto Forum:
  


Current Time: Wed Jul 09 23:27:53 EDT 2025

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

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

Back to the top