Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xpand/Xtend] : xtext extensions importation
[Xpand/Xtend] : xtext extensions importation [message #1414451] Sun, 31 August 2014 10:38 Go to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Hi,


I write a xtend module where I import some xtend modules :

«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»


I've added in dependencies :

org.eclipse.xtext
and
org.eclipse.xtext.generator

plugins


But:
whereas all is fine for
«EXTENSION org::eclipse::xtext::EcoreUtils

«EXTENSION org::eclipse::xtext::generator::Naming»
raises an error :
Quote:
Error while importing extension: Resource org::eclipse::xtext::generator::Naming
not found.


What is destabilizing : at the same time, I able to import a java class of the same package, org.eclipse.xtext.generator.

What's the ""fuck"" ?

Someone can help me ?

Thanks a lot by advance

[Updated on: Sun, 31 August 2014 11:05]

Report message to a moderator

Re: [Xpand/Xtend] : xtext extensions importation [message #1414464 is a reply to message #1414451] Sun, 31 August 2014 11:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
Hi,

i have no idea on that

xtend 1 question should be asked in the m2t forum.
are you writing a own fragment or what is that reason that you are doing this?

- are you sure the path for the .ext file is <somesourcefolder>/org/eclipse/xtext/generator/Naming.ext and the project has xtend/xpand nature?
- does the generator bundle export that package?
- happens the error in the editor or running the code.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand/Xtend] : xtext extensions importation [message #1414610 is a reply to message #1414464] Sun, 31 August 2014 22:26 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Running code conducts to this :
2964 INFO CompositeComponent - Generator(generator): generating 'Root::Root FOR model' => src-gen
3249 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component generator of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'Root::Root for List' found!
[23,27] on line 1 'EXPAND Root::Root FOR model'


Does it mean my xpand code is valid because this message occurs whether the faulty extensions code is present or not ?

Re: [Xpand/Xtend] : xtext extensions importation [message #1414725 is a reply to message #1414610] Mon, 01 September 2014 06:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
HI,

it said that the workflow calls the template with a list but is not declared


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand/Xtend] : xtext extensions importation [message #1414737 is a reply to message #1414725] Mon, 01 September 2014 07:26 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
This is what astonishes me because it is not supposed to be a List.
Here is the workflow that raises this error:


<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
  <platformUri value=".."/>
</bean>

<component id="dirCleaner"
  class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
  directory="src-gen"/>
  
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.xtext.mwe.UriBasedReader">
  <uri value="platform:/resource/my.generator.project/data/Xtext.xtext" />
  <register class='org.eclipse.xtext.XtextStandaloneSetup'/>
  <load slot='model'/>
</component>  
  
 <component id="generator" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
	  <expand value="Root::Root FOR model"/>
	  <fileEncoding value="ISO-8859-1"/>
	  <outlet path="src-gen">
	   <postprocessor class="org.eclipse.xpand2.output.JavaBeautifier"/>
	  </outlet>
	</component>
</workflow>



And this is the template called:
«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»

«IMPORT xtext»

«DEFINE grammar FOR Grammar»
«ENDDEFINE»
Re: [Xpand/Xtend] : xtext extensions importation [message #1414739 is a reply to message #1414737] Mon, 01 September 2014 07:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
<expand value="Root::Root FOREACH model"/>

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand/Xtend] : xtext extensions importation [message #1414758 is a reply to message #1414739] Mon, 01 September 2014 08:38 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Yep ! You are great.

I received a more obscur message now :

Workflow interrupted. Reason: No Definition 'Root::Root for org::eclipse::xtext::impl::GrammarImpl' found!


I can't understand because the workflow worked pretty well with the UML tutorial example.

Let me guess ... org.eclipse.xtext.impl doens't need to be exported at least ?!
Re: [Xpand/Xtend] : xtext extensions importation [message #1414763 is a reply to message #1414758] Mon, 01 September 2014 08:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
Hi,

which metamodel did you configure in the generator and which is in the templates.
looks like the workflow uses java beans


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand/Xtend] : xtext extensions importation [message #1414782 is a reply to message #1414763] Mon, 01 September 2014 09:37 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
My source codes remain the same as presented in this topic

whereas my configuration is the following :

https://lh5.googleusercontent.com/tBxtnHlM0Kdy2pkWvf7JvX0S7Mqz9G738FNq_bCH3rdmuChVKMyP2Oi-RxGbTgqcE9td5fjBzhc=w1349-h736


runRoot.mwe is modified as you've suggested :

<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
  <platformUri value=".."/>
</bean>

<component id="dirCleaner"
  class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
  directory="src-gen"/>
  
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.xtext.mwe.UriBasedReader">
  <uri value="platform:/resource/my.generator.project/data/Xtext.xtext" />
  <register class='org.eclipse.xtext.XtextStandaloneSetup'/>
  <load slot='model'/>
</component>  
  
 <component id="generator" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
	  <expand value="Root::Root FOREACH model"/>
	  <fileEncoding value="ISO-8859-1"/>
	  <outlet path="src-gen">
	   <postprocessor class="org.eclipse.xpand2.output.JavaBeautifier"/>
	  </outlet>
	</component>
</workflow>

[Updated on: Mon, 01 September 2014 09:43]

Report message to a moderator

Re: [Xpand/Xtend] : xtext extensions importation [message #1414785 is a reply to message #1414782] Mon, 01 September 2014 09:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
The Question was: how does the template look like

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand/Xtend] : xtext extensions importation [message #1419593 is a reply to message #1414785] Mon, 08 September 2014 21:17 Go to previous message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Indeed, I guess you couldn't see my screenshot (with template code, config, console messages, ...). The actual edit is the template, Root.xpt :

https://lh5.googleusercontent.com/t2-0JYzaEd24F8Hye9YkOJwUdabi1IaagAtFdCNuwZ7bvdTSjFReqhCPxmoAySqw05L-=w1146-h782

Here is what you can see on screenshot above :

«EXTENSION org::eclipse::xtext::generator::parser::antlr::AntlrGrammar»
«EXTENSION org::eclipse::xtext::generator::parser::antlr::Parser»
«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»

«IMPORT xtext»


«DEFINE grammar FOR Grammar»

«ENDDEFINE»

[Updated on: Mon, 08 September 2014 21:23]

Report message to a moderator

Previous Topic:Simple New Grammar
Next Topic:Xtext: Cross-Referenzce + JvmTypeReference
Goto Forum:
  


Current Time: Thu Dec 12 21:00:59 GMT 2019

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

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

Back to the top