Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Any way to access the name of a reference in the ScopeProvider?
Any way to access the name of a reference in the ScopeProvider? [message #1017622] Tue, 12 March 2013 08:22 Go to next message
Shavarsh Odajavan is currently offline Shavarsh OdajavanFriend
Messages: 7
Registered: March 2013
Junior Member
Hi, i'm trying to implement the ScopeProvider in my project and i would like to know if there's a way to do the following.
I have a block structured grammar with variable declarations, expressions, assignments etc.
Let's say (a part of) the structure is like this:

[...]

VarDeclaration: 'integer' name=VariableName

Assignment: name=[VariableName] '=' value=INT;

VariableName: name=ID ;

[...]

Is there a way in the getScope(EObject context, EReference reference) function to access the name of the variable in the assignment before the scope is resolved?
Something like reference.getVariableName() just to know the name of the variable i just typed?

Thanks in advance
Re: Any way to access the name of a reference in the ScopeProvider? [message #1017677 is a reply to message #1017622] Tue, 12 March 2013 10:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi you can use the nodemodelutil to read the text

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Any way to access the name of a reference in the ScopeProvider? [message #1018189 is a reply to message #1017622] Wed, 13 March 2013 10:53 Go to previous message
Shavarsh Odajavan is currently offline Shavarsh OdajavanFriend
Messages: 7
Registered: March 2013
Junior Member
Thanks for the reply, but i solved it in another way. Anyway i will keep in mind your advice if needed in the future.
Previous Topic:Xtext Grammar
Next Topic:Templates auto format
Goto Forum:
  


Current Time: Thu Apr 25 02:28:18 GMT 2024

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

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

Back to the top