ATL:How to add Sequence of TupleType? [message #413955] |
Thu, 30 July 2009 09:26 |
venkatesh Messages: 41 Registered: July 2009 |
Member |
|
|
Hi ,
I have declared a tuple type in which i want to add multiple tuple
can you please tell me the syntax for adding tuple data type
I have declared like this but it's not correct
helper def: descriptor : Sequence(TupleType(emp : String,f:String, s :
String)) =Tuple{( emp= 'a', f = 'b',s='c'),(emp= 'c', f = 'd',s='f')};
2.How to add String[] in Map data type
In Map we have Key value pair.if the value is a String then we can add
like this
helper def : modelKind : Map(String,String) =
Map {('KM3','KM3'),
('UML2','UML2')};
but if the value is a String[] ?
How to define helper for this
Map<String,String[]>
here A & B a key
Map{('A',('generalizedTimeMatch','0.0.17.1218.127.13.27')
('B',('booleanMatch','0.0.17.1218.127.13.13'))}
Thanks,
venky
|
|
|
|
Re: ATL:How to add Sequence of TupleType? [message #439021 is a reply to message #432142] |
Fri, 31 July 2009 05:30 |
venkatesh Messages: 41 Registered: July 2009 |
Member |
|
|
Hi ,
I got it.
this is the syntax for iterating the TupleType.It'll be useful for
beginners i guess.
helper def: names : Sequence(TupleType(emp:String, s : String)) =
Sequence{ Tuple { emp ='self.x',s='ss'},Tuple {emp='sss',s='sssssssssss'}};
helper def: getnames() :TupleType(emp:String, s : String)=
thisModule.names->iterate(e;acc:TupleType(emp:String, s :
String)=Tuple{emp='oo', s =''}|
if(e.emp= 'sss') then
Tuple{ emp =e.emp,s=e.s}
else
acc
endif
);
regards
venky
|
|
|
Powered by
FUDForum. Page generated in 0.02940 seconds