Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Language A accessing B language during code generation
Language A accessing B language during code generation [message #1787591] Tue, 29 May 2018 18:30 Go to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Hi guys,
I have two Eclipse xtext languages, project A and project B, each one with a grammar.
Language B is a code generation complement for language A.
Language A starts the code generation and it must call some methods in language B to help the work (I do Eclipse Extension Points to solve this). After, language B starts its code generation, based on elements defined in language A.

All works fine when the two plug-ins are executed in Eclipse IDE.

But it fails when running in continuous integration with Maven because Maven cannot access the extension points and so some files aren't generated as in Eclipse IDE.

Some hint about the right way for how language A can access language B during the code generation?

Some hint about how language A can access language B during the code generation without Eclipse extension points? Or there is another way to achieve this?

Thanks,
Márcio Koch.
Re: Language A accessing B language during code generation [message #1787592 is a reply to message #1787591] Tue, 29 May 2018 18:47 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
can you be more explicit what you mean by "access"

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language A accessing B language during code generation [message #1787596 is a reply to message #1787592] Tue, 29 May 2018 19:13 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Thanks for the quick reply.
The language A declares an interface (and an Eclipse extension point) that language B implements.

Language B knows A language by a referencedResource, but language A does not know B language.
Re: Language A accessing B language during code generation [message #1787597 is a reply to message #1787596] Tue, 29 May 2018 19:24 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
if you use guice to hook up/register the services you could try something like

@Inject
		IGlobalServiceProvider gsp;
		
		public void doSomething() {
			gsp.findService(URI.createURI("dummy.b"), ServiceClazz.class)...
		}


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Multiple generators
Next Topic:Creation Review Bugzilla
Goto Forum:
  


Current Time: Mon Sep 24 15:48:48 GMT 2018

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

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

Back to the top