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 Sica
Messages: 128
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 Dietrich
Messages: 6398
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
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 Sica
Messages: 128
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: Fri Oct 31 22:24:10 GMT 2014

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

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