Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » index inside for
index inside for [message #759615] Tue, 29 November 2011 10:58 Go to next message
Eclipse User
Hello,

I want to use the "i" var feature inside a for loop

Try to do :

[for (str : String | ... )]
[str.toString()/]=[i/];
[/for]

But I have a syntax error
What do I miss

Thank you
Re: [Acceleo 3] index inside for [message #759648 is a reply to message #759615] Tue, 29 November 2011 13:13 Go to previous messageGo to next message
Eclipse User
Hello,
Sorry for overposting, I forgot to tag my post with [Acceleo 3]

I want to use the "i" var feature inside a for loop

I Try to do :

[for (str : String | ... )]
[str.toString()/]=[i/];
[/for]

But I have a syntax error about i not recongnized...
What do I miss ?

Thank you
Re: [Acceleo 3] index inside for [message #760087 is a reply to message #759648] Thu, 01 December 2011 09:20 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
Hi C├ędric,

The "i" variable is there since 3.0 and should be recognized whenever you are inside of a for. Which version of Acceleo are you using? Maybe you could you provide us with a sample module that presents this issue? A basic test on my side did compile correctly.

Laurent Goubet
Obeo
Re: [Acceleo 3] index inside for [message #762021 is a reply to message #760087] Wed, 07 December 2011 12:49 Go to previous messageGo to next message
Eclipse User
Hi Laurent

Sorry for the delay of my answer
> The "i" variable is there since 3.0 and should be recognized whenever
> you are inside of a for. Which version of Acceleo are you using? Maybe
> you could you provide us with a sample module that presents this issue?
> A basic test on my side did compile correctly.


Here the code I use :
[for (str : String | sm.eAllContents(State)
->select(s | not(s.isComposite))
->collect(st | sm.getNormalizedName().toUpper() +
st.getNormalizedName().toUpperFirst()) ) separator (',\n')]
[str.toString()/]=[i/][/for]

And the error is :
Error : An error occured while saving generate.emtl : The object 'i :
Integer' is not contained in a resource.

My version of acceleo is : 3.1.1 (2011 14 09)

What do I miss ?

Best regards
Re: [Acceleo 3] index inside for [message #762026 is a reply to message #762021] Wed, 07 December 2011 12:59 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
Hi Cedric,

Ok, that's not "not recognized" but indeed a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=357770) Smile. Unfortunately, this bug made it in the 3.1.1 build (it was fixed the day after we built that version).

I can get an integration build of the 3.1.2 ready today if you need this fixed in the 3.1 stream, otherwise you should be safe using the 3.2 stream.

Laurent Goubet
Obeo
Previous Topic:[Acceleo] Progress Reporting
Next Topic:[Acceleo] how to get the ID of an EObject
Goto Forum:
  


Current Time: Sat Sep 20 00:09:52 GMT 2014

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

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