Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] #in not accepted lexically in ATL
[ATL] #in not accepted lexically in ATL [message #95643] Tue, 18 November 2008 04:38 Go to next message
Eclipse UserFriend
Hi,
ATL is having a stange behaviour and i have no idea how to resolve this:
I have a rule that should return a string that i will affect to an
enumeration literal, it may return #in or #out or #inout:

helper context UML2!Port def: getFlowDirection(stereotypeName : String,
taggedValue : String) : String =
if (selection1 = 'IN!in') then (#in)
else if (selection2= 'IN!out') then (#out)
else if (selection3 = 'IN!inout') then (#inout)
else (#inout)
endif
endif
endif;

Two problems occur here:
1-Writing #in is not accepted by the lexical verification, looks like
in is a reserved name or something.
2-If i change that to '#in' it compiles and executes but then i get a
strange behaviour; the #out cases work very well, but the #inout cases
return a java.lang.NullPointerException . The '#in' return an error
because it is expecting a #in string and this was the first problem.

Can anybody help with this problem?
Thanks in advance
Re: [ATL] #in not accepted lexically in ATL [message #95657 is a reply to message #95643] Tue, 18 November 2008 05:43 Go to previous messageGo to next message
Eclipse UserFriend
Frederic Jouault answered me in Bugzilla and gave this answer:

--Some metamodels have classes, attributes, or references that collide
with ATL
--keywords. When this happens, these names may be escaped by surrounding
them
--with double quotes.

--For instance, in the case of an enumeration literal named *in*, this
results
--in:

--#"in"

The #"in" worked for the #in litteral but didn't work for the #inout !!

half the problem is resolved, not so bad!
Re: [ATL] #in not accepted lexically in ATL [message #95670 is a reply to message #95657] Tue, 18 November 2008 11:25 Go to previous message
Eclipse UserFriend
problem solved:
the problem disappeared when i got rid of the comments that were in the
helper!
Previous Topic:[ATL] Setting enumeration value to enumeration tagged value
Next Topic:Ocl integration
Goto Forum:
  


Current Time: Thu May 08 08:02:58 EDT 2025

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

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

Back to the top