Skip to main content



      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 04:22 Go to next message
Eclipse UserFriend
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 06:08 Go to previous messageGo to next message
Eclipse UserFriend
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
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 06:53 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 00:07:15 EDT 2025

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

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

Back to the top