Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Combining JvmModelInferrer with IGenerator
Combining JvmModelInferrer with IGenerator [message #928656] Sun, 30 September 2012 21:32 Go to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 112
Registered: July 2009
Senior Member
Hello,

my question is, how you would combine the "old" IGenerator approach with the new JvmModelInferrer approach?

I did it with a bad hack already, but I would like to know the official way to do it.

Use case:
I model web pages, generate JSF controller classes and would like also to generate XML descriptors.

Thank you!
Re: Combining JvmModelInferrer with IGenerator [message #929013 is a reply to message #928656] Mon, 01 October 2012 06:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi the inferred model is already used by the jvmmodelgenerator which
is an igenerator

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Combining JvmModelInferrer with IGenerator [message #935232 is a reply to message #929013] Sat, 06 October 2012 20:58 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 112
Registered: July 2009
Senior Member
Hello Christian,


so you mean, I have to override the "generate" method and call the second generator manually before or after the super() call?
In this case I will have also to take care myself of the injections within the second generator. Is it really the official way to do this
or I just miss something?

Thank you!


Best Regards,
Boris
Re: Combining JvmModelInferrer with IGenerator [message #935254 is a reply to message #935232] Sat, 06 October 2012 21:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i dont get your problem. subclass the jvmmodelgenerator. override org.eclipse.xtext.xbase.compiler.JvmModelGenerator.doGenerate(Resource, IFileSystemAccess)
or dispatch into org.eclipse.xtext.xbase.compiler.JvmModelGenerator.internalDoGenerate(EObject, IFileSystemAccess)
and simply bind it.

thats all. there is nothing special. so "official way" since it is trivial that none even thinks of one

and why take care of injections? there is nothing different to other injections

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Combining JvmModelInferrer with IGenerator [message #944166 is a reply to message #928656] Sun, 14 October 2012 22:58 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 112
Registered: July 2009
Senior Member
Hello Christian,


I get your point. It's indeed very easy. Smile

A tiny problem, I still have, is the

@SuppressWarnings("restriction")


I forced to add. Actually, there are many places where I need this thing. Every time I do it, I think, there must be some other way to do, what I'm trying to do.

What do you think about restrictions? (and about restrictions in the special case?)

Thank you!


Regards,
Boris
Re: Combining JvmModelInferrer with IGenerator [message #944886 is a reply to message #944166] Mon, 15 October 2012 06:33 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi it is just that the Xtext guys can/may change the api

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:a DSL for type systems/checkers for xtext languages
Next Topic:Where is the recursive rule?
Goto Forum:
  


Current Time: Fri Apr 19 12:51:42 GMT 2024

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

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

Back to the top