Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross-referencing to non-Xtext elements
Cross-referencing to non-Xtext elements [message #1690986] Wed, 01 April 2015 12:39 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

I've been away from Xtext for a couple of years now and I have a feeling that I saw the answer to this question somewhere, but can't find it now. I hope someone can point me right or answer.

I have a DSL used to generate C code and it contains references to other C code. If I want to navigate between the DSL and C, I need to either
- fill the Xtext index with elements from the C code (locating the C elements off-line)
- catch "unresolved references" and ask locate the element when needed

What would be the right way? If the first option, then how do I let the index know about the external elements?

Thanks in advance!

best regards,
Vlad
Re: Cross-referencing to non-Xtext elements [message #1694129 is a reply to message #1690986] Thu, 30 April 2015 18:09 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Vlad,

I would go with the first suggestion. We do exactly that for Java.
In order to put non-xtext languages on the scope (into the index) you need to redefine their signatures in terms of EMF elements and then register a ResourceServiceProvider that will transform the original representation into an EMF one. You'll likely also need a special resource implementation and URI scheme.
It is best to look at the org.eclipse.xtext.common.types bundle to see how we do that for Java.

Cheers,
Sven
Re: Cross-referencing to non-Xtext elements [message #1694133 is a reply to message #1694129] Thu, 30 April 2015 19:26 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Aha, I see. Thanks a lot!
/Vlad
Previous Topic:Plan to support other platforms?
Next Topic:Xtext Formatting
Goto Forum:
  


Current Time: Wed Apr 24 20:10:32 GMT 2024

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

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

Back to the top