ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0008153Part 01: TTCN-3 Core LanguageNew Featurepublic11-12-2022 19:2126-01-2024 16:27
Matthias Simon 
Jens Grabowski 
normalminorhave not tried
assignedopen 
 
 
19.2, 19.3
Nokia - Matthias Simon
0008153: Extend usage of break and continue statements
* Allow break statements in select statements.
* Allow optional label to break/continue from nested loops
No tags attached.
docx CR8153.docx (114,777) 11-12-2022 20:07
http://oldforge.etsi.org/mantis/file_download.php?file_id=4093&type=bug
Issue History
11-12-2022 19:21Matthias SimonNew Issue
11-12-2022 20:07Matthias SimonSummaryAdd optional label to break and continue => Extend usage of break and continue statements
11-12-2022 20:07Matthias SimonDescription Updatedbug_revision_view_page.php?rev_id=607#r607
11-12-2022 20:07Matthias SimonFile Added: CR8153.docx
20-12-2022 12:49Jens GrabowskiNote Added: 0016441
20-12-2022 12:49Jens GrabowskiAssigned To => Jens Grabowski
20-12-2022 12:49Jens GrabowskiStatusnew => assigned
07-11-2023 17:01Jens GrabowskiNote Added: 0016542
09-11-2023 21:15Gusztáv AdamisNote Added: 0016570
10-11-2023 12:03Gusztáv AdamisNote Added: 0016581
26-01-2024 16:27Olivier GenoudNote Added: 0016608

Notes
(0016441)
Jens Grabowski   
20-12-2022 12:49   
Additional idea: Add label to loop header.

TTF discussion: To be discussed in the scope of the next TTF. Proposal cannot be implemented as proposed for select case statement. It would lead to a backwards incompatible change.
(0016542)
Jens Grabowski   
07-11-2023 17:01   
TTF discussion: Break and Continue shall be analysed in the scope of the major release. Additional ideas include the deprecation of Goto as well as introduction of breaks/continue across several scope units.
(0016570)
Gusztáv Adamis   
09-11-2023 21:15   
After diiscussions within TTF:

Possible solution can be "named cycles"
while (...) {
   while (...){
      break w1; //or continue w1;
      }
   } : w1

break w1; will terminate both cycles, execution continues with the next instruction after w1.
continue w1; will terminate the innermost cycle and takes the next iteration of the "w1" cycle.

Similar construct can be applied for nested alt instructions with break/repeat "named alt").

alt {
  [] ...{
          alt {
            [] ... {break a1;}
            ...
          }
        ...
  [] ....
        }
}: a1;

"altlabels" and "cyclelabels" can be mixed, until they do not "jump" out of the scope.

alt {
[] ... { while (...) { break a2;}}
...
}: a2

If this construct is implemented it may cause to deprecate the goto/label.
(0016581)
Gusztáv Adamis   
10-11-2023 12:03   
The resolution of the ticket shall be postponed to the next major revision.
(0016608)
Olivier Genoud   
26-01-2024 16:27   
It seems to be another flavour of "goto", so we do not see the benefit. On the other hand, it is increasing the complexity of the language allowing further flavours of code writing. Also, we are not aware that code cannot be written using existing means.