How to call a called rule.[ATL] [message #733627] |
Wed, 05 October 2011 04:49  |
Eclipse User |
|
|
|
Hi;
I want to know how I can call a called rule; but I have not succeeded,an error always occurred;please hepl me it is obligatory to use a called rule. in the ALT Manual, there is no such syntax. I hope the author can add it later on. Thanks.
here is the excerpt:
rule Square2Circel {
from E : Square!Square
to c : Circle!Circle
(
--Color <- thisModule.transfs(E.Color),
Cle<-E.cle,
Rayon<-E.Length
)
do
{
c.Color <- thisModule.transfs(E.Color);
}
}
rule transfs(n:String){ -- a called rule
to
c : Circle!Circle(
Color<-n
)
}
|
|
|
|
Re: How to call a called rule.[ATL] [message #733688 is a reply to message #733650] |
Wed, 05 October 2011 08:37  |
Eclipse User |
|
|
|
ok;
thnks a lot Sylvain EVEILLARD but after several triad i found thant the problem is on the way that i call the called rule :
old code:
rule Square2Circel {
from E : Square!Square
to c : Circle!Circle
(
--Color <- thisModule.transfs(E.Color),
Cle<-E.cle,
Rayon<-E.Length
)
do
{
c.Color <- thisModule.transfs(E.Color);
}
}
rule transfs(n:String){ -- a called rule
to
c : Circle!Circle(
Color<-n
)
}
after correction:
rule transfs(n:String){ -- a called rule
to
c : Circle!Circle(
Color<-n
)
do{
c;
}
}
rule Square2Circel {
from E : Square!Square
to c : Circle!Circle
(
-- <- thisModule.transfs(E.Color),
Cle<-E.cle,
Rayon<-E.Length
)
do
{
--thisModule.transfs('red');
thisModule.transfs(E.Color);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.04117 seconds