Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Problem with hyphens in attributes
Problem with hyphens in attributes [message #666181] Tue, 19 April 2011 12:25 Go to next message
Ton Tu is currently offline Ton TuFriend
Messages: 16
Registered: June 2010
Junior Member
Hi all,
In an ECORE model, I can declare an attribute with a name including the hyphen, for example:
name-of-attribute: EString
. However, it turns out that we cannot indicate that attribute in an ATL rule. More precisely, the statement:
name-of-attribute<- a.name
will raise an error. Except changing the attribute's name, do you guys have any other solution? Thanks in advance!
Re: Problem with hyphens in attributes [message #666242 is a reply to message #666181] Tue, 19 April 2011 14:44 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
I believe this breaks the parsing of the ATL file so you don't have much choice. You can use an imperative block tho :

do{
t.refSetValue('name-of-attribute',a.name);
}
Re: Problem with hyphens in attributes [message #666263 is a reply to message #666181] Tue, 19 April 2011 16:21 Go to previous messageGo to next message
Ton Tu is currently offline Ton TuFriend
Messages: 16
Registered: June 2010
Junior Member
Many thanks to your help Smile
Re: Problem with hyphens in attributes [message #666270 is a reply to message #666242] Tue, 19 April 2011 16:30 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 19/04/2011 15:44, Sylvain EVEILLARD wrote:
> I believe this breaks the parsing of the ATL file so you don't have
> much choice. You can use an imperative block tho :
>
> do{
> t.refSetValue('name-of-attribute',a.name);
> }
ATL might want to adopt the OCL 2.3 syntax of underescore prefixed
string for awkward identifiers.

_'name-of-attribute'

Regards

Ed Willink
Previous Topic:OclType and oclAsType issues
Next Topic:[ATL] Format of output model
Goto Forum:
  


Current Time: Fri Mar 29 14:13:13 GMT 2024

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

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

Back to the top