![]() |
![]() |
![]() |
![]() |
![]() |
The GOTO Statement
In order to be able to express repetitive behaviour in a convenient way, TTCN allows statement lines to be labelled so that jumps may be made to them from later points in the tree. A GOTO is denoted either by:
Infinite loops should be avoided, i.e. entering the GOTO loop should always depend on some event occurring or condition being fulfilled.
The following rules should be followed:
- a GOTO can only be made within a single tree in a behaviour description;
- the label should be unique within the behaviour description;
- line numbers may not be used as labels;
- the label must always be associated with the first statement line in a given set of alternatives, i.e. a GOTO cannot cause a jump to the middle of a set of alternatives;
- a result of the previous rule means that a GOTO to the first level of alternatives in a test step (i.e. the test step root) is not allowed;
- a GOTO may only be made to an ancestor node in the behaviour tree, i.e. a jump to a part of the tree that has previously been executed;
- no other statements may be used in conjunction with a GOTO.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |