Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Cross Referencing Problem
Cross Referencing Problem [message #1355134] Wed, 14 May 2014 11:39 Go to next message
Eclipse UserFriend
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 11:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

xxxx=[Port|QualifiedName]

....


QualifiedName: ID ("." ID)*;

should do the trick
Re: Cross Referencing Problem [message #1355155 is a reply to message #1355134] Wed, 14 May 2014 11:46 Go to previous messageGo to next message
Eclipse UserFriend
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 11:51 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 11:46:37 EDT 2025

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

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

Back to the top