Skip to main content



      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 08:59 Go to next message
Eclipse UserFriend
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 09:16 Go to previous messageGo to next message
Eclipse UserFriend
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 11:13 Go to previous message
Eclipse UserFriend
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 Jul 23 03:43:07 EDT 2025

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

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

Back to the top