Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to know in validation method how many segments has a qualified name link ?
How to know in validation method how many segments has a qualified name link ? [message #956920] Wed, 24 October 2012 22:31 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi,

Taking this grammar piece as example:
'Type' name=QualifiedName ('extends' superType=[Type|QualifiedName])? 

To identify the superType, we can use a qualified names that contains one or more segments depending of the imports being used.

I would like to identify in a validation method how many segments are being used to identify the linked element, so I can infer if it is Single or Qualified name.

Could someone point me how can I do that?

thanks
Re: How to know in validation method how many segments has a qualified name link ? [message #957279 is a reply to message #956920] Thu, 25 October 2012 05:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi have a look at NodeModelUtil.findNodesForFeature (or something
like that - I don't know the exact name)

--
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
Re: How to know in validation method how many segments has a qualified name link ? [message #958306 is a reply to message #957279] Thu, 25 October 2012 22:59 Go to previous message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi Christian,

NodeModelUtil plus some strings manipulation give me what I needed.

thanks a lot.

Cristiano
Previous Topic:Xtext crashing
Next Topic:Yet Another Question about Cross Referencing Languages
Goto Forum:
  


Current Time: Fri Apr 19 15:59:35 GMT 2024

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

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

Back to the top