Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending the Xtext index
Extending the Xtext index [message #1234543] Wed, 22 January 2014 08:22 Go to next message
Udo Walker is currently offline Udo WalkerFriend
Messages: 74
Registered: July 2009
Member
Hi,

I have a cross reference in my DSL to some external files. The files are stored in a folder of the project where the DSL file is stored.
I want to be able to declare the files folder in my DSL.

Is it possible to build the Xtext index with resources where the path to these resources is stored in instances of a DSL which is defined by Xtext?

Or can I access no instances of my DSL while I build the index?

How can I extend the index (if I know the folder name for my external files) when I use Xtext 2.4.3 and above?

With regards,
Udo
Re: Extending the Xtext index [message #1234557 is a reply to message #1234543] Wed, 22 January 2014 08:58 Go to previous messageGo to next message
Udo Walker is currently offline Udo WalkerFriend
Messages: 74
Registered: July 2009
Member
I forgot to mention that I use an Xbase based DSL and don't know how to extend the index for a DSL based on Xbase.
Re: Extending the Xtext index [message #1234601 is a reply to message #1234543] Wed, 22 January 2014 10:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Can you be a bit more specific? Hard answer generally

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


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: Extending the Xtext index [message #1234718 is a reply to message #1234601] Wed, 22 January 2014 16:56 Go to previous messageGo to next message
Udo Walker is currently offline Udo WalkerFriend
Messages: 74
Registered: July 2009
Member
Hmm, in my DSL I cross reference also files which are no Java types nor other DSL files. I would like to use the quick fix combined with scoping to let the user enter valid file names.

As I understand Xtext it works in 3 steps:
1. the program file (instance of my DSL) is parsed
2. the index is built (all Java types and other instances of my DSL are collected)
3. the cross references are resolved

And I understood that I have to extend the built in index ( I mean the default functionality of XBase). The default index of an Xbase based DSL consists of all Java types referenced from the Java project and all other DSL files of the same language. Now to reference my files as possible cross references I have to extend the XBase based index with IEObjectDescription implementations for the file resources.

To build the mapping between a qualified name and the URI of the files I need somehow the absolute path of the files i.e. for my case the project relative folder where the files are stored.
I want to be able to declare this folder in an instance of my DSL as attribute value.

Is this possible or do I have to know the folder before the DSL is parsed?

The second question was how to extend the index with the IEObjectDescription instances for my files in an XBase environment?
Re: Extending the Xtext index [message #1234726 is a reply to message #1234718] Wed, 22 January 2014 17:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi you cross reference objects not files ? So you want simply a file
with hyperlink ability and completion and validation? What kind of
file is that

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


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: Extending the Xtext index [message #1234740 is a reply to message #1234726] Wed, 22 January 2014 17:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
so if it just file names why dont you do this without scoping ...

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: Extending the Xtext index [message #1234945 is a reply to message #1234740] Thu, 23 January 2014 07:37 Go to previous messageGo to next message
Udo Walker is currently offline Udo WalkerFriend
Messages: 74
Registered: July 2009
Member
First: These are not just file names. They are also serialized EMF models. I want to be able to extend the scope of parts the DSL by the content of these files. Especially later during the generation phase of my target platform/files I want to be able to navigate through the object model of the referenced file as if they are part of the DSL.

Second: How ca I guarantee that the files exist and have the correct content? Would this be part of the Validator which is found as stub in the non-ui plug-in of my DSL?
Re: Extending the Xtext index [message #1234950 is a reply to message #1234945] Thu, 23 January 2014 07:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi,

serialized EMF models => this is what an IResourceServiceProvider is made for
http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/


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:How to use newer version Guava in Xtext with maven build?
Next Topic:Injection not working when Xtezt is launch from EMF model
Goto Forum:
  


Current Time: Sun Nov 29 08:27:19 GMT 2020

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

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

Back to the top