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 08:25 Go to next message
Ton Tu is currently offline Ton Tu
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 10:44 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
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 12:21 Go to previous messageGo to next message
Ton Tu is currently offline Ton Tu
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 12:30 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4008
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: Mon Jul 28 16:43:09 EDT 2014

Powered by FUDForum. Page generated in 0.02467 seconds