Commit d77188d2 authored by yoogx's avatar yoogx

Merge branch 'master' of https://github.com/yoogx/ocarina

parents 0192de4d 5bcaae76
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -36,11 +36,11 @@ with Ocarina.AADL_Values;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.AADL_XML.Mapping;
with Ocarina.Backends.Utils;
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.Backends.XML_Tree.Nutils;
use Ocarina.Backends.AADL_XML.Mapping;
use Ocarina.Backends.Utils;
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;
use type ATN.Node_Kind;
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;
......@@ -126,24 +126,6 @@ package body Ocarina.Backends.AADL_XML.Main is
return N;
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;
AADL_XML_Node : Node_Id := No_Node;
Current_XML_Node : Node_Id := No_Node;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2014-2015 ESA & ISAE. --
-- Copyright (C) 2014-2016 ESA & ISAE. --
-- --
-- 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- --
......@@ -126,8 +126,8 @@ package body Ocarina.Backends.Alloy is
(Get_Name_String
(Normalize_Name (Fully_Qualified_Instance_Name (E)))) &
" extends Component{}{");
else
Put_Line (Kind (E)'Img);
Root_System_Name := Normalize_Name (Display_Name (Identifier (E)));
Put_Line
......@@ -135,7 +135,6 @@ package body Ocarina.Backends.Alloy is
"one sig " &
To_Lower (Get_Name_String (Root_System_Name)) &
" extends Component{}{");
end if;
Put_Line
......@@ -172,7 +171,7 @@ package body Ocarina.Backends.Alloy is
Put_Line (FD, "none");
end if;
-- Rule#3: list properties
-- Rule #3: list properties
Put (FD, ASCII.HT & "properties=");
if Present (AIN.Properties (E)) then
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -31,11 +31,11 @@
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.Cheddar.Mapping;
with Ocarina.Backends.Utils;
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.Backends.XML_Tree.Nutils;
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;
procedure Visit_Component (E : Node_Id);
......@@ -54,26 +54,7 @@ package body Ocarina.Backends.Cheddar.Main is
procedure Visit_Thread (E : Node_Id);
procedure Visit_Process (E : Node_Id);
procedure Visit_Data (E : Node_Id);
----------------------------
-- 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;
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
Root_System_Node : Node_Id := No_Node;
Cheddar_Node : Node_Id := No_Node;
......
......@@ -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