Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross Referencing Problem
Cross Referencing Problem [message #1355134] Wed, 14 May 2014 15:39 Go to next message
Arunkumar Ramaswamy is currently offline Arunkumar RamaswamyFriend
Messages: 57
Registered: April 2014
Member
I want to create xtext grammer for the below syntax

System simple_sys {
Component talker {Port t_port}
Component listener {Port l_port}
Connector pubsub {
Roles { publisher subscriber}
}
Attachments {
talker.t_port to pubsub.publisher
listener.l_port to pubsub.subscriber
}
}

How do I use cross referencing mechanism to refer, for eg, talker.t_port, pubsub.publisher, etc.

Any help much appreciated.

Re: Cross Referencing Problem [message #1355146 is a reply to message #1355134] Wed, 14 May 2014 15:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

xxxx=[Port|QualifiedName]

....


QualifiedName: ID ("." ID)*;

should do the trick


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Cross Referencing Problem [message #1355155 is a reply to message #1355134] Wed, 14 May 2014 15:46 Go to previous messageGo to next message
Arunkumar Ramaswamy is currently offline Arunkumar RamaswamyFriend
Messages: 57
Registered: April 2014
Member
Attachments:
'Attachments' '{'
(attach += Attach)*
'}'
;

Attach:
source = [Port] 'to' target = [Role]
;

I used the above grammar, but how do i refer to ports which is in the scope of component or Role which is in scope of Connector.

I am quite new to xtext Smile
Re: Cross Referencing Problem [message #1355166 is a reply to message #1355146] Wed, 14 May 2014 15:51 Go to previous message
Arunkumar Ramaswamy is currently offline Arunkumar RamaswamyFriend
Messages: 57
Registered: April 2014
Member
That solved my problem,
Thanks Christian
Previous Topic:Prevent Workspace-Rebuild if using xtext-based plugin
Next Topic:one file extension, multiple sub-grammars
Goto Forum:
  


Current Time: Sat Apr 20 02:37:45 GMT 2024

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

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

Back to the top