[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt.amw] Re: [ATL] Injection problem in qATL

Hi Marcos, this is one of my rules:

rule createBinding(featName : MOF!"String", element : ATL!SimpleOutPatternElement, var : ATL!VariableDeclaration) { -- : ATL!Binding
to
atl : ATL!Binding(
outPatternElement <- element,
propertyName <- featName,
value <- val
),
val : ATL!NavigationOrAttributeCallExp(
name <- featName, source <- valSource
),
valSource : ATL!VariableExp(
referredVariable <- var
)
do {
atl;
}
}


The calling of the rule works, but somewhere in the return elements goes wrong;
in fact everything works if I remove the "to" section of the rule and I print the input parameters in the "do" section.


I ask this to you, because I tested the same rule with the old AMW4ATL and everything works correctly...

Do you have any suggestion?

Regards, Ivano

Marcos Didonet Del Fabro wrote:

Hi Ivano,

the code of the rules with error are in 'normal' ATL files or the code is injected using the .inject ('OUT','ebnf', <exp>) method?

There are two things to pay attention when developing called and lazy rules:

- in called rules, you should have a return expression at the end of the imperative part;

- in lazy rules, the type of the input pattern should be respected.


Regards,

Marcos

Ivano wrote:
Hi Marcos, I am using the modified version of AMW4ATL and I still have problems:
when a called rule (that returns something) is executed I get an EmptyStack exception;


when a lazy rule is executed I get an ClassCastException;

These exceptions arise only if I use the modified version of AMW4ATL, do you have any idea about this issue??

Thank you, Ivano