Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0(Need your help, folks)
Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0 [message #1689307] Mon, 23 March 2015 09:15 Go to next message
Alexei Adamovich is currently offline Alexei AdamovichFriend
Messages: 9
Registered: May 2013
Junior Member
I use imported EMF model in my project. The model is produced from a grammar by ordinary process of Xtext artifacts generation using mwe2 workflow. Then I used a "switching from an inferred Ecore model to an imported one" procedure, described by Lorenzo Bettini in his blog.

After transition from Xtext 2.7.3 to Xtext 2.8.0 I found that the technique doesn't works anymore for me. So I started repeating step-by-step the Lorenzo's tutorial. The point when it becomes broken is in the middle of the process described by Lorenzo: we just

    got the generated model;
    created the "emf-gen" folder for placing code generated by EMF generator, and tweaked the build.properties to add emf-gen to the list of sources;
    renamed generated model folder to the "custom" one;
    changed the GenModel file, so that the EMF model classes are generated into emf-gen instead of src-gen;
    changed the MWE2 file: enabled the "emf-gen" directory cleaner and the EcoreGenerator component (?called "fragment" in Lorenzo's text?), commented the DirectoryCleaner element for the model directory, added the loading of our custom Ecore file in the "language" section of the Generator component; disabled EMFGeneratorFragment (we need no ecore model inference anymore).
    added the dependency (ecore class) in the MANIFEST;
    in the Xtext grammar replaced the generate statement with an import statement.

So at this point we read in Lorenzo's text: Quote:
"Now we're ready to run the MWE2 workflow, and you should get no error (if you followed all the above instructions); you can see that now the EMF model classes are generated into the emf-gen folder (the corresponding packages in the src-gen folders are now empty and you can remove them)"


Definitely, when I run the ".mwe2" workflow in the Xtext2.7.3 environment all goes smooth (see the LBX2EM_x273.output attached).

In contrast, when I run the workflow in Xtext 2.8.0, I get a bunch of errors (see the LBX2EM_x280.output attached). As you can see, there is no info output on registering of the imported model in the 2.8.0 output. And, as far as I understand, all following errors are caused by this non-importing. Am I right? What is the source of the problem?

Or does the Lorenzo's technique completely not work anymore in 2.8.0? If so, how can I switch from generated model to the imported one?

Thanks in advance!

Alexei

P.S. Since I have less then 5 messages, forum engine forbids me to post any references (including the full class names). So I've uploaded Lorenzo's grammar, mwe2 workflow (adapted for 2.7.3), mwe2 console outputs and Lorenzo's post URL.
Re: Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0 [message #1689944 is a reply to message #1689307] Tue, 24 March 2015 17:49 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi there

yes, that technique does not seem to work anymore, and I still haven't
got time to update it...

in the meantime, you may want to have a look at this mwe2 which works on
Xtext 2.8.0 (you may also want to have a look at the last commits
concerning that file); with that, you should be able to fix your mwe2.

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0 [message #1689947 is a reply to message #1689944] Tue, 24 March 2015 17:50 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Sorry, I forgot the URL :)

https://github.com/LorenzoBettini/xsemantics/blob/master/plugins/it.xsemantics.dsl/src/it/xsemantics/dsl/GenerateXsemantics.mwe2

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0 [message #1690161 is a reply to message #1689944] Wed, 25 March 2015 14:05 Go to previous message
Alexei Adamovich is currently offline Alexei AdamovichFriend
Messages: 9
Registered: May 2013
Junior Member
Hi!

Quote:
in the meantime, you may want to have a look at this mwe2 which works on
Xtext 2.8.0 (you may also want to have a look at the last commits
concerning that file); with that, you should be able to fix your mwe2.


It works! Thanks a lot, Lorenzo!

Alexei
Previous Topic:Extending existing files with Xtend
Next Topic:Xtext refactoring support
Goto Forum:
  


Current Time: Thu Apr 25 10:51:19 GMT 2024

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

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

Back to the top