Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » code gen. /no duplicate
code gen. /no duplicate [message #1695311] Wed, 13 May 2015 12:59 Go to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Hi all,

i want generate e.g. "import xyz" depends on my model.
How can i prevent duplicate imports?
I think i must use a vector or so, but how?

Example:

«FOR f : e.entityMembers»	    	    
	  «IF f.type.class == EntityImpl»import "«f.type.name».proto" «ENDIF»
	«ENDFOR»	 


Thanks
Simon
Re: code gen. /no duplicate [message #1695318 is a reply to message #1695311] Wed, 13 May 2015 13:14 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 747
Registered: July 2009
Location: Dortmund, Germany
Senior Member

«FOR name : e.entityMembers.filter[type.class == EntityImpl].map[type.name].toSet.sortBy[it]»
«name».proto"
«ENDFOR»


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: code gen. /no duplicate [message #1695319 is a reply to message #1695318] Wed, 13 May 2015 13:17 Go to previous message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Thank you, works fine!
Previous Topic:Antlr version
Next Topic:Formatter2: formatting merging
Goto Forum:
  


Current Time: Tue Apr 20 07:15:39 GMT 2021

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

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

Back to the top