Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross References (Scoping) without names(Objects don't have (nice) human readable names)
Cross References (Scoping) without names [message #1282480] Wed, 02 April 2014 11:15 Go to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
Hi,

I would like to use Scoping but my objects don't have nice human readable names but 25 digits UIDs.
I would like to use the descriptions of the objects. Since they are not unique I would add a counter. So like 'K1("the description containing spaces")'.
Is this possible?

More details:
I have a Query emf model edited in a form based editor.
Within a Query one can define Key Figures. Key figures have a 25 digits UID and a description.
Queries also contain Formulas. For Formula I have developed the grammar with Xtext. Basically one can do arithmetic with double numbers and the key figures. So key figures are the cross references I want to use.
If there is a key figure with the description "My Amount" I would like to use "K1("My Amount") as Qualifier.
I did not succeed providing this in the IScope impl since it is expecting an ID (refering to terminals.ID) correct? Content Assist did not work for the cross references and if entered by key board the syntax check reported an error.

Thanks, Marcus
Re: Cross References (Scoping) without names [message #1282484 is a reply to message #1282480] Wed, 02 April 2014 11:23 Go to previous messageGo to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
... if above mentioned is not possible working with the UID's as qualified names would be also ok for me.
If the UID's can be converted to something human readable (in content assist, the editor, ...) using e.g. a ValueConverter.
Is this possible?

Maybe this is the even the better solution since UID's a full qualified names.
Re: Cross References (Scoping) without names [message #1282485 is a reply to message #1282480] Wed, 02 April 2014 11:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13512
Registered: July 2009
Senior Member
Hi

i am not sure if this answers your question xxx=[YYY] stands for xxx=[YYY|ID] wich means "by ID" so you have to use xxx=[YYY|STRING]

update: the rest is a matter of scoping respectively IQualifiedNameProvider


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 02 April 2014 11:24]

Report message to a moderator

Re: Cross References (Scoping) without names [message #1282494 is a reply to message #1282485] Wed, 02 April 2014 11:38 Go to previous messageGo to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
Did not really get is. Could you apply it to my example?
Re: Cross References (Scoping) without names [message #1282510 is a reply to message #1282494] Wed, 02 April 2014 12:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13512
Registered: July 2009
Senior Member
You dont have a grammar?!?

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 References (Scoping) without names [message #1282517 is a reply to message #1282510] Wed, 02 April 2014 12:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13512
Registered: July 2009
Senior Member
http://christiandietrich.wordpress.com/2011/07/16/iqualifiednameproviders-in-xtext-2-0/

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 References (Scoping) without names [message #1283191 is a reply to message #1282517] Thu, 03 April 2014 06:22 Go to previous messageGo to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
Hi Christian,

thank a lot.
That's a quite nice feature (yyy=[Xxx|String] and really simple.
You should mention it in the documentation. (I didn't find it)

I use a Scope to provide objects and qualified names since I need to provide a counter in each of the qualified names (S1..., S2..., S3...) so I need to calculate them all at once.
In a QualifiedNameProvider this would be more complicated I guess.
Re: Cross References (Scoping) without names [message #1283202 is a reply to message #1283191] Thu, 03 April 2014 06:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13512
Registered: July 2009
Senior Member
see "The Grammar Language" -> "The Syntax" -> Cross-References

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:errors in MWE2 editor and Maven project
Next Topic:Generic Graphic View can't integrate with Xtext
Goto Forum:
  


Current Time: Mon Aug 03 18:46:15 GMT 2020

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

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

Back to the top