Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Parser error using ParameterDirectionKind enumeration
[QVTO] Parser error using ParameterDirectionKind enumeration [message #88702] Fri, 22 August 2008 08:30 Go to next message
Eclipse UserFriend
Originally posted by: koen.yskout.cs.kuleuven.be

Hi,

The UML metamodel contains a ParameterDirectionKind enum.
However, its elements (in, out, inout, return) are reserved words in
QVTO, resulting in parser errors when I try to use them (example at the
end). Can this be fixed, or is there a way to get around this problem?

Thanks,
Koen


modeltype UML uses uml("http://www.eclipse.org/uml2/2.1.0/UML");

transformation demo();

main() {
var param := object UML::Parameter {
direction := ParameterDirectionKind::in;
};
}
Re: [QVTO] Parser error using ParameterDirectionKind enumeration [message #88717 is a reply to message #88702] Fri, 22 August 2008 10:26 Go to previous messageGo to next message
Alfons Laarman is currently offline Alfons LaarmanFriend
Messages: 71
Registered: July 2009
Member
Hoi Koen,

Have you tried to put them in quotes? Double or single.


Regards,

Alfons

"Koen Yskout" <koen.yskout@cs.kuleuven.be> schreef in bericht
news:g8ltf7$to8$1@build.eclipse.org...
> Hi,
>
> The UML metamodel contains a ParameterDirectionKind enum.
> However, its elements (in, out, inout, return) are reserved words in QVTO,
> resulting in parser errors when I try to use them (example at the end).
> Can this be fixed, or is there a way to get around this problem?
>
> Thanks,
> Koen
>
>
> modeltype UML uses uml("http://www.eclipse.org/uml2/2.1.0/UML");
>
> transformation demo();
>
> main() {
> var param := object UML::Parameter {
> direction := ParameterDirectionKind::in;
> };
> }
Re: [QVTO] Parser error using ParameterDirectionKind enumeration [message #88732 is a reply to message #88717] Fri, 22 August 2008 11:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: koen.yskout.cs.kuleuven.be

I tried, but I didn't find a method that the parser accepts :-(
I suspect that quotes are only used for strings.

The QVT spec once mentions an 'asEnumeration()' string operation, which
sounds as if it would be useful in my case, but I can't find more info
on that.

regards,
Koen


Alfons Laarman wrote:
> Hoi Koen,
>
> Have you tried to put them in quotes? Double or single.
>
>
> Regards,
>
> Alfons
>
> "Koen Yskout" <koen.yskout@cs.kuleuven.be> schreef in bericht
> news:g8ltf7$to8$1@build.eclipse.org...
>> Hi,
>>
>> The UML metamodel contains a ParameterDirectionKind enum.
>> However, its elements (in, out, inout, return) are reserved words in QVTO,
>> resulting in parser errors when I try to use them (example at the end).
>> Can this be fixed, or is there a way to get around this problem?
>>
>> Thanks,
>> Koen
>>
>>
>> modeltype UML uses uml("http://www.eclipse.org/uml2/2.1.0/UML");
>>
>> transformation demo();
>>
>> main() {
>> var param := object UML::Parameter {
>> direction := ParameterDirectionKind::in;
>> };
>> }
>
>
Re: [QVTO] Parser error using ParameterDirectionKind enumeration [message #88747 is a reply to message #88702] Fri, 22 August 2008 11:07 Go to previous message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Koen,

Just prepend the '_' character to the clashing identifier.
ParameterDirectionKind::_in

The OCL spec defines this way for resolving such conflicts,
See "9.3 Concrete Syntax"

Regards,
/Radek


On Fri, 22 Aug 2008 10:30:30 +0200, Koen Yskout =

<koen.yskout@cs.kuleuven.be> wrote:

> Hi,
>
> The UML metamodel contains a ParameterDirectionKind enum.
> However, its elements (in, out, inout, return) are reserved words in =

> QVTO, resulting in parser errors when I try to use them (example at th=
e =

> end). Can this be fixed, or is there a way to get around this problem?=

>
> Thanks,
> Koen
>
>
> modeltype UML uses uml("http://www.eclipse.org/uml2/2.1.0/UML");
>
> transformation demo();
>
> main() {
> var param :=3D object UML::Parameter {
> direction :=3D ParameterDirectionKind::in;
> };
> }



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Previous Topic:transformation ATL
Next Topic:Looking for a sample recursive hepler?
Goto Forum:
  


Current Time: Wed Oct 04 14:55:31 GMT 2023

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

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

Back to the top