Commit 1503bc62 authored by yoogx's avatar yoogx
Browse files

* Use Visit_Subcomponents_Of_G

parent 221cc216
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2011-2015 ESA & ISAE. -- -- Copyright (C) 2011-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,11 +36,11 @@ with Ocarina.AADL_Values; ...@@ -36,11 +36,11 @@ with Ocarina.AADL_Values;
with Ocarina.ME_AADL; with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes; with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Tree.Nodes; with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities; with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.XML_Tree.Nodes; with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils; with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.AADL_XML.Mapping; with Ocarina.Backends.AADL_XML.Mapping;
with Ocarina.Backends.Utils;
package body Ocarina.Backends.AADL_XML.Main is package body Ocarina.Backends.AADL_XML.Main is
...@@ -49,14 +49,14 @@ package body Ocarina.Backends.AADL_XML.Main is ...@@ -49,14 +49,14 @@ package body Ocarina.Backends.AADL_XML.Main is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils; use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.AADL_XML.Mapping; use Ocarina.Backends.AADL_XML.Mapping;
use Ocarina.Backends.Utils;
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes; package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package XTN renames Ocarina.Backends.XML_Tree.Nodes; package XTN renames Ocarina.Backends.XML_Tree.Nodes;
use type ATN.Node_Kind; use type ATN.Node_Kind;
procedure Visit_Component (E : Node_Id); procedure Visit_Component (E : Node_Id);
procedure Visit_Subcomponents_Of (E : Node_Id); procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
function Map_Component (E : Node_Id) return Node_Id; function Map_Component (E : Node_Id) return Node_Id;
...@@ -126,24 +126,6 @@ package body Ocarina.Backends.AADL_XML.Main is ...@@ -126,24 +126,6 @@ package body Ocarina.Backends.AADL_XML.Main is
return N; return N;
end Map_Component; end Map_Component;
----------------------------
-- Visit_Subcomponents_Of --
----------------------------
procedure Visit_Subcomponents_Of (E : Node_Id) is
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;
Root_System_Node : Node_Id := No_Node; Root_System_Node : Node_Id := No_Node;
AADL_XML_Node : Node_Id := No_Node; AADL_XML_Node : Node_Id := No_Node;
Current_XML_Node : Node_Id := No_Node; Current_XML_Node : Node_Id := No_Node;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2010-2015 ESA & ISAE. -- -- Copyright (C) 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
with Ocarina.ME_AADL; with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes; with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities; with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.XML_Tree.Nodes; with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils; with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.Cheddar.Mapping; with Ocarina.Backends.Cheddar.Mapping;
with Ocarina.Backends.Utils;
package body Ocarina.Backends.Cheddar.Main is package body Ocarina.Backends.Cheddar.Main is
...@@ -44,8 +44,8 @@ package body Ocarina.Backends.Cheddar.Main is ...@@ -44,8 +44,8 @@ package body Ocarina.Backends.Cheddar.Main is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils; use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.Cheddar.Mapping; use Ocarina.Backends.Cheddar.Mapping;
use Ocarina.Backends.Utils;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package XTN renames Ocarina.Backends.XML_Tree.Nodes; package XTN renames Ocarina.Backends.XML_Tree.Nodes;
procedure Visit_Component (E : Node_Id); procedure Visit_Component (E : Node_Id);
...@@ -54,26 +54,7 @@ package body Ocarina.Backends.Cheddar.Main is ...@@ -54,26 +54,7 @@ package body Ocarina.Backends.Cheddar.Main is
procedure Visit_Thread (E : Node_Id); procedure Visit_Thread (E : Node_Id);
procedure Visit_Process (E : Node_Id); procedure Visit_Process (E : Node_Id);
procedure Visit_Data (E : Node_Id); procedure Visit_Data (E : Node_Id);
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
----------------------------
-- Visit_Subcomponents_Of --
----------------------------
procedure Visit_Subcomponents_Of (E : Node_Id);
procedure Visit_Subcomponents_Of (E : Node_Id) is
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;
Root_System_Node : Node_Id := No_Node; Root_System_Node : Node_Id := No_Node;
Cheddar_Node : Node_Id := No_Node; Cheddar_Node : Node_Id := No_Node;
......
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