Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » CharSequence inside while
CharSequence inside while [message #989673] Fri, 07 December 2012 09:28 Go to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Xtend code generation. How can I realize something like this:
       def compileCaseWithRange(Case c){
		val initial=c.value
		val final=c.finalValue.finalValue
		var i=initial
		while(i<=final){
			'''«printCase(i)»'''
			i=i+1
		}
		'''break;'''	
	}


Very thanks.
Re: CharSequence inside while [message #989680 is a reply to message #989673] Fri, 07 December 2012 09:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
What about something like

'''
<<FOR i : start..end>>
<<print(i)>>
<<ENDFOR>>
Break;
'''

--
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: CharSequence inside while [message #989701 is a reply to message #989680] Fri, 07 December 2012 11:09 Go to previous message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Christian Dietrich wrote on Fri, 07 December 2012 10:49

<<FOR i : start..end>>


Perfect! A simple collection of int!

Very thanks for help and kindness Christian.
Previous Topic:Problem while cross-referencing. Solution review
Next Topic:Errors and warnings not shown in my editor
Goto Forum:
  


Current Time: Thu Apr 25 04:24:32 GMT 2024

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

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

Back to the top