Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.4.1] Resolve cross references without 'name' in target file
[Xtext 2.4.1] Resolve cross references without 'name' in target file [message #1200955] Thu, 21 November 2013 13:59 Go to next message
Wayne Campbell is currently offline Wayne Campbell
Messages: 11
Registered: June 2013
Junior Member
Hey again,

I need a few hints for a quite tricky situation. I am currently developing a grammar for a multiple file language. Basically, the involved files and folders are organized as follows:

/project/root/root
/project/subfolder/data
/project/another_subfolder/data


The 'root' file contains the names of all the subfolders that are contained within the project:
PROJECT_PART {
  ... some information ...
  NAME=SUBFOLDER
}

PROJECT_PART {
  ... some information ...
  NAME=ANOTHER_SUBFOLDER
}


I want to establish cross references from the root file to specific files within the project.

The problem now is that the names are NOT contained within the 'data' files, but are derived from their path.

I played around with a custom scope provider, but this does not solve the problem as it is 'too late' to deal with the situation when the scope provider is executed.

A possible solution would be adding the derived name to a PROJECT_PART entity at parse-time. Is there a way to do so? Is there a better solution? Is there a solution at all?

Many thanks in advance!
Re: [Xtext 2.4.1] Resolve cross references without 'name' in target file [message #1200993 is a reply to message #1200955] Thu, 21 November 2013 14:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6301
Registered: July 2009
Senior Member
Hi,

you can adopt the iqualifiednameprovider (subclass defaultdeclarative...) and determine the name from the resources uris)
Re: [Xtext 2.4.1] Resolve cross references without 'name' in target file [message #1201179 is a reply to message #1200993] Thu, 21 November 2013 16:13 Go to previous message
Wayne Campbell is currently offline Wayne Campbell
Messages: 11
Registered: June 2013
Junior Member
Whoa, that was fast Smile

Thank you, this works pretty fine!
Previous Topic:Force serialization of equal values?
Next Topic:[Xtext 2.3.1] : Unexpected non-LL(*) decisions due to recursive rule invocations
Goto Forum:
  


Current Time: Wed Sep 17 23:52:29 GMT 2014

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

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