Debian Codegraph @

gcc/testsuite/gnat.dg/opt27_pkg.adb

raw
1 package body Opt27_Pkg is
2
3 type Node_Rec_T is record
4 Element : Element_T;
5 Left : Node_T;
6 Right : Node_T;
7 end record;
8
9 function Is_Null (Node : in Node_T) return Boolean is
10 begin
11 return (Node = null);
12 end Is_Null;
13
14 function Find_Elem (Template : Template_T; List : List_T) return Node_T is
15 Element_Found : Boolean := False;
16 Node_Walker : Node_T := null;
17 begin
18 Node_Walker := List.First_Node;
19
20 while not Element_Found and (Node_Walker /= null) loop
21
22 if Is_Match (Node_Walker.Element, Template) then
23 Element_Found := True;
24 else
25 Node_Walker := Node_Walker.Right;
26 end if;
27 end loop;
28
29 return Node_Walker;
30 end;
31
32 end Opt27_Pkg;