Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » grammar with imported model
grammar with imported model [message #827794] Fri, 23 March 2012 20:12 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

I took the model generated from my grammar and moved it to a separate plugin, created an .ecore file and a generator, moved the "org.eclipse.emf.ecore.generated_package" extension point to the other plugin, replaced "generate" with "import" in the grammar, qualified all types with the imported package name, added dependency to the new plugin and adjusted the associated .mwe2 (StandaloneSetup) and it looks like it works fine.

With one exception: in the editor, I get "Could not resolve reference to EPackage..." and follow-up errors for all types in that package. I could swear that it has been working at one time, but now this error doesn't go away whatever I do...

Please someone tell me what I am missing here. I'm sure it's something absolutely obvious - in hindsight...

BTW, for what I need to do it feels like I could better use a postprocessor to enhance the generated model, but the FAQ links to those topics point to the top of the docs and there seems to be no info on that anymore. Is Xtext2EcoreTransformer still possible to extend? How?

best regards,
Vlad
Re: grammar with imported model [message #827799 is a reply to message #827794] Fri, 23 March 2012 20:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

this should still work.
how does your grammar file look like?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: grammar with imported model [message #827808 is a reply to message #827799] Fri, 23 March 2012 20:35 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

I just found the problem and it was a stupid mistake, as I feared: I was still referring to the package with the "http://..." uri, when I should have used "platform:/resource/..." because it's in a plugin that is not installed in my running instance. Duh!

Sorry for the noise.

best regards,
Vlad
Re: grammar with imported model [message #827809 is a reply to message #827808] Fri, 23 March 2012 20:36 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I would still like to know if model postprocessing is still possible and where I can find details about it.

regards,
Vlad
Re: grammar with imported model [message #827810 is a reply to message #827809] Fri, 23 March 2012 20:37 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Of course, I found the answer just after posting
http://christiandietrich.wordpress.com/2011/07/22/customizing-xtext-metamodel-inference-using-xtend2/

/Vlad
Previous Topic:Mixin grammar generates dependency to non-existing class
Next Topic:Xtext, Xbase 2.3 - expressions with no side effects
Goto Forum:
  


Current Time: Thu Apr 25 09:41:49 GMT 2024

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

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

Back to the top