Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross Referencing with a different attribute of a rule
Cross Referencing with a different attribute of a rule [message #1032430] Wed, 03 April 2013 01:43 Go to next message
Roza Ghamari is currently offline Roza GhamariFriend
Messages: 82
Registered: January 2013
Member
Hi all,

In my DSL, I need to cross reference a rule using a different variable than it's name. For example my rule is like:

rule1:
name = ID "and" name2 = ID
;

rule2:
"ref" [rule1|name2]
;

This always gives errors and cannot be compiled.

I also tried adding a rule for name2 like

Name2String return ecore::EString:
ID
;

The error is going away when I change the rule2 to "ref" [rule1|Name2String] but it still uses the default name attribute in rule1 to reference it.

Is there any way to solve this problem in xtext?

Thanks very much!
Re: Cross Referencing with a different attribute of a rule [message #1032528 is a reply to message #1032430] Wed, 03 April 2013 05:22 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi you have to customize the iqualifiednameprovider
http://christiandietrich.wordpress.com/2011/07/16/iqualifiednameproviders-in-xtext-2-0/
--
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 03 April 2013 05:48]

Report message to a moderator

Previous Topic:Setting the key value for a map from imported ecpre model
Next Topic:cross reference into other DSL files
Goto Forum:
  


Current Time: Tue Apr 23 15:57:32 GMT 2024

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

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

Back to the top