Skip to main content


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 CampbellFriend
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 DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

you can adopt the iqualifiednameprovider (subclass defaultdeclarative...) and determine the name from the resources uris)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 CampbellFriend
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: Fri Mar 29 09:33:37 GMT 2024

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

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

Back to the top