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: 13530
Registered: July 2009
Senior Member
Hi,

xxxx=[Port|QualifiedName]

....


QualifiedName: ID ("." ID)*;

should do the trick


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
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 Aug 15 01:52:09 GMT 2020

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

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

Back to the top