Hi,
Thank you, all who answered my questions, you were very helpful!
/Joahn
Original Message
From: Matthias Jung [This email address is being protected from spambots. You need JavaScript enabled to view it.]
Sent: den 13 februari 2004 09:32
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Semantics of Alt-Statement (was Follow-up on: No break or con
tinue statements?)
Hi Johan,
Happy to help you out this time.
...
alt
{
[]PCO1.receive(something)
{
log("reached leaf A");
}
[]PCO1.receive
{
alt
{
[]PCO1.receive
{
log("reached leaf B");
}
}
}
}
log("Is there life after the alt?");
...
In any case, the log statement "Is there life after the alt" will be
executed,
as long as there is no deadlock situation detected before.
if "something" is received, it prints "reached leaf A" before.
if anything other arrives, it waits for another message, then prints
"reached leaf B"
For repeating the alt-statement, there is the "repeat" statement. It is NOT
the same
as a GOTO, since the repeat statement can also jump from the inside of an
altstep
to the beginning of the alt. A goto can not do that. Therefore, the repeat
statement
has more justification to exist, than "break" or "continue".
Semantics of the Alt-Statement differs in TTCN-2 and 3.
You can always achive the behavior like TTCN-2 by putting an additional
"stop" statement
at the end of each branch.
Regards,
Matthias