Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How obtain EMF element of certain type up in the AST
How obtain EMF element of certain type up in the AST [message #1018685] Thu, 14 March 2013 10:08 Go to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Hi all Smile

Is there some utility method to find out a node of certain type up in the EMF tree, starting from an element of the AST?


Thanks in advance,
Marco
Re: How obtain EMF element of certain type up in the AST [message #1018690 is a reply to message #1018685] Thu, 14 March 2013 10:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13313
Registered: July 2009
Senior Member
Do you mean "EObject" with node?
org.eclipse.xtext.EcoreUtil2.getContainerOfType(EObject, Class<T>)


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How obtain EMF element of certain type up in the AST [message #1018703 is a reply to message #1018690] Thu, 14 March 2013 10:34 Go to previous messageGo to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Just what I wanted, thanks for your fast help! Smile
Re: How obtain EMF element of certain type up in the AST [message #1018713 is a reply to message #1018703] Thu, 14 March 2013 10:47 Go to previous messageGo to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Sorry, another question: and if I'd like to get an object in the AST of certain type by name?

Is there such a method?
Re: How obtain EMF element of certain type up in the AST [message #1018741 is a reply to message #1018713] Thu, 14 March 2013 11:48 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13313
Registered: July 2009
Senior Member
I guess you have to write that method yourself.

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:Error running workflow : Couldn't find extension
Next Topic:ImportURI for ecore models and Xbase scoping
Goto Forum:
  


Current Time: Mon Jan 20 14:08:58 GMT 2020

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

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

Back to the top