Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Problem Implementing linking-scoping(How can I implement my scope provider to make the linking mechanism working in my grammar?)
Problem Implementing linking-scoping [message #645398] Thu, 16 December 2010 21:00 Go to next message
Eclipse UserFriend
I've a problem (Im a newbie) implementig a scope provider for this example grammar:

/*****************************************/
Program:

ports+=port*

main=main;

port:

{port} "inputPort"|"outputPort" name=ID portBody=PortBody;

PortBody:

"{" "Operation" ":" name=ID "}";

main:

{main} "{" opCalls += opCall* "}";

opCall:

op=[PortBody] "(" INT ( "," INT)* ")";

/*****************************************/

How can I implement my scope provider to make the linking mechanism working in my grammar (e.g I wold link sum in the snippet down here)

inputPort pt1{

Operation: sum

}


main {

sum(1,2)

}


Re: Problem Implementing linking-scoping [message #645432 is a reply to message #645398] Fri, 17 December 2010 04:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

The short answer is: The linking/scoping works out of the box, provided you use the SimpleNameFragment instead of the QualifiedNameFragment (search this forum or the documentation).
Right now, the name used for "sum" is pt1.sum (qualified name calculated using the names of the containers as well).

Alex
Re: Problem Implementing linking-scoping [message #645457 is a reply to message #645432] Fri, 17 December 2010 05:11 Go to previous messageGo to next message
Eclipse UserFriend
And an equally short semi-answer is: you might find some hints in http://dslmeinte.wordpress.com/2010/09/06/tricks-for-impleme nting-scoping/ (and sorry for the shameless plugging again Very Happy).
Re: Problem Implementing linking-scoping [message #645497 is a reply to message #645457] Fri, 17 December 2010 08:51 Go to previous message
Eclipse UserFriend
Thank you very much to both! I really like this newgroup, fully and promptly answers!
Previous Topic:Problem on adding xtext to Eclipse3.6
Next Topic:Content Assistant Proposal
Goto Forum:
  


Current Time: Sat Jul 05 03:06:53 EDT 2025

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

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

Back to the top