Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » GeneratorFragment refused to work
GeneratorFragment refused to work [message #757495] Fri, 18 November 2011 16:11 Go to next message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Just another Newbie Question-
I tried to create a Generator and set im my .mwe file these properties to 'true':

          // generator API
            fragment = generator.GeneratorFragment {
                generateMwe = true
                generateJavaMain = true
            }


But nothing happened. After debugging a while I noticed that this code fragment in the GeneratorFragment class
	public boolean isGenerateJavaMain(Grammar grammar) {
		if (XbaseGeneratorFragment.doesUseXbase(grammar)) {
			return false;
		}
		return generateJavaMain;
	}

prohibits what I expeced as my grammar uses xbase. What is the rationale behind this? How do I get a proper generator for a dsl which uses xbase?
Re: GeneratorFragment refused to work [message #757498 is a reply to message #757495] Fri, 18 November 2011 16:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13423
Registered: July 2009
Senior Member
Hi,

you are intended to write a jvmModelinferrer and then the generic JvmModelGenerator is used

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: GeneratorFragment refused to work [message #757500 is a reply to message #757498] Fri, 18 November 2011 16:30 Go to previous messageGo to next message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Ah - I see. I need to dive into this (new) concept. Thanks.

But there is a problem left. In my case I have a 'classic' persistence dsl describing also entites. So I want to generate Java source - by extending my PersistenceJvmModelInferrer - but I also need to generate sql-ddl code stuff. What is the best/right way to do so?

/Tilo
Re: GeneratorFragment refused to work [message #757503 is a reply to message #757500] Fri, 18 November 2011 16:35 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13423
Registered: July 2009
Senior Member
Hi,

there are lots of possibilities
(1) write a complete own IGenerator and use XbaseCompiler within
(2) subclass JvmModelGenerator and overwrite _internalDoGenerate(EObject, IFilesystemaccess) method
(3) ....

in (1) and (2) add a binding for igenerator to the runtime module

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 18 November 2011 16:36]

Report message to a moderator

Previous Topic:Errors set in JavaValidator don't appear in the generation
Next Topic:compile Xtext programs
Goto Forum:
  


Current Time: Sat Apr 04 06:45:33 GMT 2020

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

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

Back to the top