Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » importURI(import resource)
importURI [message #763251] Fri, 09 December 2011 12:34 Go to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
Hi, i have a bit stupid question. If i use importURI feature in a grammar that has a cross-reference, what is the difference as the ref accesses the other dsl directly regardless the import statement? what does it import actually and to where..

Thanks,
Mokhtar
Re: importURI [message #763350 is a reply to message #763251] Fri, 09 December 2011 16:11 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13412
Registered: July 2009
Senior Member
Hi,

i am not quite sure what this question all about. but importing means: make it visible.

~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: importURI [message #763362 is a reply to message #763350] Fri, 09 December 2011 16:32 Go to previous messageGo to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
Hi, visible in any sense? assuming that the importing dsl uses no cross-reference

Thank you
Re: importURI [message #763369 is a reply to message #763362] Fri, 09 December 2011 16:46 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13412
Registered: July 2009
Senior Member
No,

you can only reference stuff from the file you are within or from imported files.
so if you dont use any cross refs it is totally nonsense to use imports

~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, 09 December 2011 16:46]

Report message to a moderator

Re: importURI [message #763378 is a reply to message #763369] Fri, 09 December 2011 16:56 Go to previous messageGo to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
but i still can cross-reference elments from files in "src" without importing them!
Thanks
Re: importURI [message #763381 is a reply to message #763378] Fri, 09 December 2011 17:02 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13412
Registered: July 2009
Senior Member
then you missed to configure your binding right e.g. by changing the languae workflow i guess

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, 09 December 2011 17:03]

Report message to a moderator

Re: importURI [message #763385 is a reply to message #763381] Fri, 09 December 2011 17:09 Go to previous messageGo to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
so by default: cross-reference is not cross files unless you ajust an import rule using the special feature importURI?
or oppisite i.e. one needs to first turn off cross accessing and then only imported files can be cross-referenced?
Re: importURI [message #763387 is a reply to message #763385] Fri, 09 December 2011 17:14 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13412
Registered: July 2009
Senior Member
No,

this is the default:

            fragment = scoping.ImportNamespacesScopingFragment {}
            fragment = exporting.QualifiedNamesFragment {}


you can enhance this by adding importedNamespace stuff to the grammar

or you change the workflow e.g. to

 fragment = scoping.ImportURIScopingFragment {}
 fragment = exporting.SimpleNamesFragment {}
 fragment = scoping.ImportNamespacesScopingFragment {}
 fragment = exporting.QualifiedNamesFragment {}


thus only local stuff is accessable unless you add importURI stuff to the grammar

~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: importURI [message #763391 is a reply to message #763387] Fri, 09 December 2011 17:23 Go to previous messageGo to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
Thank you so much! I have another concerns with qualified names for which i will create a new topic soon
Mokhtar
Re: importURI [message #763761 is a reply to message #763391] Sat, 10 December 2011 14:07 Go to previous messageGo to next message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
Just to add, enabling both SimpleNamesFragment and QualifiedNamesFragment is not possible because those bindings are final. I have something similar working on Wink
Re: importURI [message #763784 is a reply to message #763761] Sat, 10 December 2011 15:10 Go to previous messageGo to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member
Dear Phil, could you tell me what is the solution?
Thank you in advance,
Mokhtar
Re: importURI [message #763798 is a reply to message #763784] Sat, 10 December 2011 15:44 Go to previous message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
choose one of the namings, there is I think no reason to use them both
Previous Topic:Source file handling for artefacts which shouldn't be overwritten
Next Topic:Codegeneration next to DSL
Goto Forum:
  


Current Time: Mon Mar 30 14:12:37 GMT 2020

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

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

Back to the top