Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [xpand] fixed indentation
[xpand] fixed indentation [message #541467] Mon, 21 June 2010 09:43 Go to next message
Rubén Porras Campo is currently offline Rubén Porras CampoFriend
Messages: 61
Registered: July 2009
Is there any way to say to XPAND2, that I want a text to be located at at least column number NN?

I would like to have some basic indentation for variable assignment. At the moment I use a self-written function that takes the column number up to the inserted text, the inserted text, and the desired column. Like this:

«FOREACH this.getParameters() AS p-»
    «p.getName()»«spacesToPos(4, f.getName(), 21)» = «f.getValue()»); 

But this solution is not very good, I would like a solution that doesn't need the programmer to count spaces and provide the text two times. Something like

«FOREACH this.getParameters() AS p-»
    «p.getName()»«spacesToPos(21)» = «f.getValue()»); 

Is this possible?
Re: [xpand] fixed indentation [message #545583 is a reply to message #541467] Thu, 08 July 2010 10:23 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14338
Registered: July 2009
Senior Member

i guess this is something one / i would rather do in a postprocessor especially cause this is a very seldom usecase.


Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Iterating over extensions
Next Topic:[acceleo] Utilisation d 'enum
Goto Forum:

Current Time: Mon Aug 15 19:24:48 GMT 2022

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

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

Back to the top