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  |
Eclipse User |
|
|
|
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   |
Alfons Laarman 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   |
Eclipse User |
|
|
|
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  |
Radomil Dvorak 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/
|
|
|
Goto Forum:
Current Time: Wed Oct 04 14:55:31 GMT 2023
Powered by FUDForum. Page generated in 0.01841 seconds
|