Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Code Beautifying
[Acceleo] Code Beautifying [message #484528] Tue, 08 September 2009 02:57 Go to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hey,

just started yesterday my first steps with Acceleo. I've some general
questions concerning the beautification of the generated code.

1. Is there a common rule for indentation? When i write my templates
with normal indentation, like this

[file (testContext.name.concat('.ttcn3'), false)]
module [testContext.name/]{
[for (dPool : DataPool | testContext.allDataPool)]
[for (dp:DataPartition|dPool.ownedPartition)]
[genTypes(dp)/]
[/for]
[/for]
}
[/file]

the outcoming is very ugly aligned, since the whole [genTypes/] part is
too much indented.

2. How to use the seperator(',') construct correctly in a for-loop.
Currentlty, the , will be inserted in the next line, not after the
generated line

boolean confirmationExpected
, integer data optional

The loop looks like

[for (p:Property | c.oclAsType(Classifier).attribute) separator(',')]
[if (p.type.oclIsTypeOf(PrimitiveType))][iterateBasicType(p)/]
[else]
Complex
[/if]
[/for]

3. Is it possible to pass a Set as a template parameter?

4. I've tried to pass a parameter like c.oclAsKindOf(Class), where c is
a Classifier, but Acceleo told me, that such an template doesn't exist.
Well, the template is there.

[template public class2type(c:Class)]

Is it possible to downcast an object during the invocation of a template?

Thanks a lot

/Timothy
Re: [Acceleo] Code Beautifying [message #484554 is a reply to message #484528] Tue, 08 September 2009 04:29 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020205090400080304000605
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Timothy,

Comments inlined below.

Timothy Marc a
Previous Topic:xtext for metamodeling
Next Topic:Check: How to activate the EMF Validation Adapter?
Goto Forum:
  


Current Time: Thu Aug 28 01:22:49 EDT 2014

Powered by FUDForum. Page generated in 0.01665 seconds