-- any decisions in the exit statement expression.
when N_Exit_Statement =>
- Extend_Statement_Sequence (N, ' ');
+ Extend_Statement_Sequence (N, 'E');
Set_Statement_Entry;
Process_Decisions (Condition (N), 'E');
when N_Loop_Statement =>
if Present (Iteration_Scheme (N)) then
+
+ -- If iteration scheme present, extend the current
+ -- statement sequence to include the iteration scheme
+ -- and process any decisions it contains.
+
declare
ISC : constant Node_Id := Iteration_Scheme (N);
begin
- Extend_Statement_Sequence (N, ISC, 'F');
+ -- While statement
if Present (Condition (ISC)) then
- Process_Decisions
- (Condition (ISC), 'W');
+ Extend_Statement_Sequence (N, ISC, 'W');
+ Process_Decisions (Condition (ISC), 'W');
+
+ -- For statement
+
else
+ Extend_Statement_Sequence (N, ISC, 'F');
Process_Decisions
(Loop_Parameter_Specification (ISC), 'X');
end if;
-- and the following regions of the syntax tree:
-- the part of a case_statement from CASE up to the expression
- -- the part of a FOR iteration scheme from FOR up to the
+ -- the part of a FOR loop iteration scheme from FOR up to the
-- loop_parameter_specification
+ -- the part of a WHILE loop up to the condition
-- the part of an extended_return_statement from RETURN up to the
-- expression (if present) or to the return_subtype_indication (if
-- no expression)
-- r renaming declaration
-- i generic instantiation
-- C CASE statement (includes only the expression)
- -- F FOR/WHILE loop statement (includes only the iteration scheme)
+ -- E EXIT statement
+ -- F FOR loop statement (includes only the iteration scheme)
-- I IF statement (includes only the condition [in the RM sense, which
-- is a decision in the SCO sense])
-- P PRAGMA
-- R extended RETURN statement
+ -- W WHILE loop statement (includes only the condition)
-- and is omitted for all other cases.
-- Statements
-- C1 = 'S' for entry point, 's' otherwise
- -- C2 = 't', 's', 'o', 'r', 'i', 'C', 'F', 'I', 'P', 'R', ' '
+ -- C2 = 't', 's', 'o', 'r', 'i',
+ -- 'C', 'E', 'F', 'I', 'P', 'R', 'W', ' '
-- (type/subtype/object/renaming/instantiation/
- -- CASE/FOR or WHILE/IF/PRAGMA/RETURN/other)
+ -- CASE/EXIT/FOR/IF/PRAGMA/RETURN/WHILE/other)
-- From = starting source location
-- To = ending source location
-- Last = False for all but the last entry, True for last entry