Skip to main content



      Home
Home » Modeling » TMF (Xtext) » code gen. /no duplicate
code gen. /no duplicate [message #1695311] Wed, 13 May 2015 08:59 Go to next message
Eclipse UserFriend
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 09:14 Go to previous messageGo to next message
Eclipse UserFriend
«FOR name : e.entityMembers.filter[type.class == EntityImpl].map[type.name].toSet.sortBy[it]»
«name».proto"
«ENDFOR»
Re: code gen. /no duplicate [message #1695319 is a reply to message #1695318] Wed, 13 May 2015 09:17 Go to previous message
Eclipse UserFriend
Thank you, works fine!
Previous Topic:Antlr version
Next Topic:Formatter2: formatting merging
Goto Forum:
  


Current Time: Tue Jul 08 01:08:11 EDT 2025

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

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

Back to the top