Skip to main content



      Home
Home » Modeling » TMF (Xtext) » grammar with imported model
grammar with imported model [message #827794] Fri, 23 March 2012 16:12 Go to next message
Eclipse UserFriend
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 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

~Christian
Re: grammar with imported model [message #827808 is a reply to message #827799] Fri, 23 March 2012 16:35 Go to previous messageGo to next message
Eclipse UserFriend
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 16:36 Go to previous messageGo to next message
Eclipse UserFriend
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 16:37 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 21:50:28 EDT 2025

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

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

Back to the top