Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Loading XtextResources correctly
Loading XtextResources correctly [message #1151224] Wed, 23 October 2013 03:49 Go to next message
Eclipse UserFriend
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 10:22 Go to previous message
Eclipse UserFriend
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: Tue Jul 01 16:29:28 EDT 2025

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

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

Back to the top