Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Re: OAW to TMF migration: ext allElements migration
Re: OAW to TMF migration: ext allElements migration [message #64716] Tue, 21 July 2009 07:16
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Marcel,

as this question is related to m2t I include the right newsgroup in this
reply. allElements() was a serious performance trap in oAW 4.3.1 as it
was kind of easy to use in combination with typeSelect - the same way
you describe it - but used to collection everthing to select a small
number of objects afterwards. That is basically a bad idea from the
complexity point of view. That's why there is no such function in Xtext.
You may want to write it on your own with the help of
EcoreUtil.getAllContents(ResourceSet). You can filter the elements with
Google Collection API. Have a look for Iterables.filter(Iterable,
Class). You'll find an example if you search the m2t newsgroup for
allElements().

Literally speaking it is almost ever a better idea to navigate the tree
directly and collect only the interesting objects in the first place.
Please consider to rewrite your checks to be more straight forward
intead of using the generic allElements-approach.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 20.07.2009 23:16 Uhr, schrieb Marcel Wagner:
> I try to migrate my OAW xtext projects to the new TMF xtext base. I have
> some trouble to migrate my checks to the java based checks. I search for
> a function to get all elements of the parsed DSL including the included
> DSL files. In OAW xtext, there was a generated extension called
> allElements() where I get all parsed elements of the DSL files. This
> function was used heavily in my checks in combination with typeSelect().
> My question now, is there a similar function in TMF to get all elements
> of the parsed DSL including the included DSL files? And how can I filter
> on this set to get only elements of a given DSL type?
>
> Thanks for the help,
> Marcel
>
Previous Topic:acceleo run configuration with model outside of workspace
Next Topic:Re: JET2 in emft project
Goto Forum:
  


Current Time: Sun Dec 21 01:18:52 GMT 2014

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

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