Commit 221cc216 authored by yoogx's avatar yoogx

* Visit_Subcomponents_Of_G: new generic function to visit

           subcomponents of a current entity.
parent a9a5a33a
......@@ -3868,9 +3868,9 @@ package body Ocarina.Backends.Utils is
return False;
end Process_Use_Defaults_Sockets;
--------------------------
-- Get_Associated_Bus --
--------------------------
-------------------------
-- Get_Associated_Bus --
-------------------------
function Get_Associated_Bus (Port : Node_Id) return Node_Id is
C : Node_Id;
......@@ -4048,4 +4048,24 @@ package body Ocarina.Backends.Utils is
return Core_Id;
end Get_Core_Id;
------------------------------
-- Visit_Subcomponents_Of_G --
------------------------------
procedure Visit_Subcomponents_Of_G (E : Node_Id) is
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
S : Node_Id;
begin
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end Visit_Subcomponents_Of_G;
end Ocarina.Backends.Utils;
......@@ -35,6 +35,15 @@ package Ocarina.Backends.Utils is
type Browsing_Kind is (By_Source, By_Destination, Default);
------------------
-- AST visitor --
------------------
generic
with procedure Visit (E : Node_Id);
procedure Visit_Subcomponents_Of_G (E : Node_Id);
-- Visit the component instance corresponding to the subcomponents of E
--------------------------
-- Directory Operations --
--------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment