Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Loading XtextResources correctly
Loading XtextResources correctly [message #1151224] Wed, 23 October 2013 07:49 Go to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hi,

we are building our own language with Xtext.

===============================================
EXPLANATION OF OUR SCENARIO
===============================================

A typical file with our language looks like this:

PROGRAM prog1
fb1();
END_PROGRAM

FUNCTION_BLOCK fb1
fun1();
END_FUNCTION_BLOCK

FUNCTION fun1
END_FUNCTION

In a normal project, we have some of such files, with various PROGRAMs, FUNCTION_BLOCKs and FUNCTIONs and these objects can be referenced across the files.

Now we use EMFIncQuery to implement queries for getting information from our data model (e.g. all FUNCTION_BLOCKs and FUNCTIONs which are referenced from a program).

EMFIncQuery takes a ResourceSet to process such a query.

===============================================
QUESTION
===============================================

Now here is my question:
Is there something like a global ResourceSet in Xtext which contains all resources which are in the workspace (or better in one project)
or do we have to load all the required Resources manually and add it to a ResourceSet.

We already tried to implement the resource loading manually, but it does not seem that this is the correct approach and we think that maybe there is a better way to do this.

Thanks for any help!

Kind regards,
Alexander



Re: Loading XtextResources correctly [message #1151680 is a reply to message #1151224] Wed, 23 October 2013 14:22 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 10/23/13 9:49 AM, schrieb Alexander Fichtinger:
> Now here is my question:
> Is there something like a global ResourceSet in Xtext which contains all
> resources which are in the workspace (or better in one project) or do we
> have to load all the required Resources manually and add it to a
> ResourceSet.

No, there is a ResourceSet per editor and per project build.
The index (IResourceDescriptions) contains information about all
resources in the workspace (via IResourceDecription)

Sven


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:New Xtext Installation in Eclipse
Next Topic:How to solve QualifiedName ambiguity
Goto Forum:
  


Current Time: Sat Dec 05 01:00:46 GMT 2020

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

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

Back to the top