Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3.1] Compilation error
[Acceleo 3.1] Compilation error [message #724934] Tue, 13 September 2011 10:16 Go to next message
Sergio  is currently offline Sergio
Messages: 21
Registered: August 2010
Location: Cardedeu
Junior Member
Hi,

I have the next code with no problem in acceleo 3.0.*, but with compilation errors in 3.1

[query public listOfParametersIn(c : Class) : Bag(Parameter) =  c.ownedOperation -> ownedParameter->select(p : Parameter | p.direction <> ParameterDirectionKind::return) -> asBag()/]


Quote:
The compilation error: 2:18:2:19 "-" expected instead of "->"


How can this be done the right way?

Thank you!!



Sergio Sacristán
http://s2o-bcn.blogspot.com/
Re: [Acceleo 3.1] Compilation error [message #725184 is a reply to message #724934] Wed, 14 September 2011 03:26 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

You have written "c.ownedOperation -> ownedParameter", but ownedParameter is not an attribute of a collection (I don't remember if "ownedOperation" returns a set, a bag, a sequence or an orderedset). You should try:

[query public listOfParametersIn(c : Class) : Bag(Parameter) =  c.ownedOperation -> collect(o: Operation | o.ownedParameter)->select(p : Parameter | p.direction <> ParameterDirectionKind::return) -> asBag()/]


or

[query public listOfParametersIn(c : Class) : Bag(Parameter) =  c.ownedOperation.ownedParameter->select(p : Parameter | p.direction <> ParameterDirectionKind::return) -> asBag()/]


Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Previous Topic:IOException with exported Acceleo project [resolved]
Next Topic:[Xpand] dynamic EXPAND statement
Goto Forum:
  


Current Time: Sun Apr 20 04:26:58 EDT 2014

Powered by FUDForum. Page generated in 0.03054 seconds