Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » error message
error message [message #534166] Tue, 18 May 2010 09:27 Go to next message
graa is currently offline graaFriend
Messages: 42
Registered: April 2010
Member
Hi,
i have 2 error message and i can't correct them
1)in ligne 4 :
no viable alternative at input '{'
2)in ligne 5:
mismatched input '<-' expecting SEMI


1helper context uml!PackageableElement def 2:machine:Sequence(uml!PackageableElement)=

3 if (thisModule.counter=0) then
4 {
5 thisModule.counter <- thisModule.counter + 1;
6 self.Leveli(self.Level0)->iterate(goalmachine; w: 7Sequence(OclAny)=Sequence{}|

8 w.union(

9 self.Leveli(goalmachine)



10 ));
thisModule.counter <- thisModule.counter + 1;
}



else
{ thisModule.counter <- thisModule.counter + 1;
self.Leveli(w)->iterate(goalmachine; w: Sequence(OclAny)=Sequence{}|

w.union(

self.Leveli(goalmachine)

));
}
endif;
thanks
Re: error message [message #534188 is a reply to message #534166] Tue, 18 May 2010 10:23 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can't have braces in OCL because you can't execute multiple operations in an OCL IF. And finally, you can't make assignments in OCL (<-).

For the increase of counter you can use an ATL workaround :
let fakeLet : OclAny = thisModule.refSetValue('counter',thisModule.counter + 1) in

Previous Topic:[ATL] set something to null (or equivalent)
Next Topic:Adding QvtBuilder to project programmatically
Goto Forum:
  


Current Time: Thu Apr 18 23:57:57 GMT 2024

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

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

Back to the top