5.8 Goto Statements
[A
goto_statement
specifies an explicit transfer of control from this
statement
to a target statement with a given label.]
Syntax
goto_statement ::= goto label_name;
Name Resolution Rules
Legality Rules
It follows from the second rule that if the
target
statement
is enclosed by such a construct, then the
goto_statement
cannot be outside.
Dynamic Semantics
Examples
Example of a loop
containing a goto statement:
<<Sort>>
for I in 1 .. N-1 loop
if A(I) > A(I+1) then
Exchange(A(I), A(I+1));
goto Sort;
end if;
end loop;
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe