Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Cannot access a class's package attribute
[Acceleo] Cannot access a class's package attribute [message #494425] Fri, 30 October 2009 15:15 Go to next message
Peter Keller is currently offline Peter KellerFriend
Messages: 14
Registered: October 2009
Junior Member
Dear all,

Can anyone explain what is wrong with this template?

[module syntaxerr('http://www.eclipse.org/uml2/2.1.0/UML')/]

[template public syntaxerr(c : Class)]
	
	[comment @main /]
	[c.package/]
	
[/template]


I get a syntax error in the MTL editor, and the message:

Quote:
token 'package' is invalid


I paused after typing 'c.' and selected 'package' from the drop-down list. If I use 'namespace' instead of 'package', it works fine.

I am using the Galileo modeling SR1 release (Linux x86_64) with Acceleo 2.6.0 installed from the Acceleo update site.

Thanks for any help,
Peter.

P.S. In case anyone is wondering what use a template like this is, I would really like to use [c.package.name/] , but need to get past this error first.
Re: [Acceleo] Cannot access a class's package attribute [message #494438 is a reply to message #494425] Fri, 30 October 2009 15:49 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010309060109070802070008
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Peter,

That's a collision between OCL keywords and UML choice of feature names.
To access UML's "package" attribute, you need to use "_package" in OCL.
The same will be true for most collisions such as this one.

Laurent Goubet
Obeo

Peter Keller a écrit :
> Dear all,
>
> Can anyone explain what is wrong with this template?
>
> [module syntaxerr('http://www.eclipse.org/uml2/2.1.0/UML')/]
>
> [template public syntaxerr(c : Class)]
>
> [comment @main /]
> [c.package/]
>
> [/template]
>
>
> I get a syntax error in the MTL editor, and the message:
>
> Quote:
>> token 'package' is invalid
>
>
> I paused after typing 'c.' and selected 'package' from the drop-down
> list. If I use 'namespace' instead of 'package', it works fine.
>
> I am using the Galileo modeling SR1 release (Linux x86_64) with Acceleo
> 2.6.0 installed from the Acceleo update site.
>
> Thanks for any help,
> Peter.
>
> P.S. In case anyone is wondering what use a template like this is, I
> would really like to use [c.package.name/] , but need to get past this
> error first.


--------------010309060109070802070008
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyLyI+T2JlbzwvYT4NCmVtYWls O2ludGVybmV0
OmxhdXJlbnQuZ291YmV0QG9iZW8uZnINCnVybDpodHRwOi8vd3d3Lm9iZW8u ZnINCnZlcnNp
b246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------010309060109070802070008--
Re: [Acceleo] Cannot access a class's package attribute [message #494441 is a reply to message #494438] Fri, 30 October 2009 16:11 Go to previous message
Peter Keller is currently offline Peter KellerFriend
Messages: 14
Registered: October 2009
Junior Member
Hi Laurent,

I had been looking at the OCL standard, but hadn't spotted the collisions with the keywords...

Merci!
Peter.

Laurent Goubet wrote on Fri, 30 October 2009 11:49

Hi Peter,

That's a collision between OCL keywords and UML choice of feature names.
To access UML's "package" attribute, you need to use "_package" in OCL.
The same will be true for most collisions such as this one.

Laurent Goubet
Obeo


Previous Topic:How JET compares with XSLT?
Next Topic:Missing GenClass while using genmodel in JET Transformation Project
Goto Forum:
  


Current Time: Thu Apr 18 10:35:40 GMT 2024

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

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

Back to the top