Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Import Resolution - XBase(Namespace Resolution - XBase)
Import Resolution - XBase [message #1740739] Thu, 18 August 2016 00:31 Go to next message
Arya Ramalingam is currently offline Arya RamalingamFriend
Messages: 5
Registered: August 2016
Junior Member
I have a requirement to convert XText/XBase based DSL to XML. I use XExpression and control the imports and Namespaces using XImportDeclaration (user Import) and XImportSectionNamespaceScopeProvider(implicit code import).
I am able to convert XExpression to my required String format using my custom code . However while doing that I could not resolve the Imports and convert the Class Names to Fully qualified Class Names with package name .
Can you guide me in the right direction.

For example :
import com.pkg1.Class1
someAction {
  Class1.method1("arg");
}

Expected Result after name space resolution:
<mytag>
     com.pkg1.Class1.method1("arg");    //Currently i get Class1.method1("arg");  
</mytag>
Re: Import Resolution - XBase [message #1740746 is a reply to message #1740739] Thu, 18 August 2016 05:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13876
Registered: July 2009
Senior Member
I don't get that question. Can you explain what you are technically doing.

There should be a reference to a jvm type inside the expression tree. This should be resolved and give you information on its qualified name


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Import Resolution - XBase [message #1740748 is a reply to message #1740746] Thu, 18 August 2016 06:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13876
Registered: July 2009
Senior Member
btw if you use xbase you should use XImportSectionNamespaceScopeProvider

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Import Resolution - XBase [message #1740824 is a reply to message #1740748] Thu, 18 August 2016 17:43 Go to previous messageGo to next message
Arya Ramalingam is currently offline Arya RamalingamFriend
Messages: 5
Registered: August 2016
Junior Member
I have a custom generator (extends from IGenerator) to convert DSL to XML.
In this generator I have a method to convert XExpression to String.

I am able to successfully inspect various Object types of XExpression and resolve the same to string. However, when i do that I would like to resolve the Imports to get the full name of the Class.

If there is an Manager Class in XBase where i can pass a class Name to find the fully qualified name with package from my generator , it will be very helpful.
Re: Import Resolution - XBase [message #1740827 is a reply to message #1740824] Thu, 18 August 2016 18:13 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13876
Registered: July 2009
Senior Member
can you please share a complete minimal reproducing example.

what Object Kind do you have i hand when querying for the fqn?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Ambiguous cross reference
Next Topic:Unexpect abmbigious grammar
Goto Forum:
  


Current Time: Sun Apr 11 05:17:31 GMT 2021

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

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

Back to the top