Commit 07467d45 authored by yoogx's avatar yoogx

* Reorganize code: Python related stuff should remain in

          Ocarina.Python_Cmd
parent aed798db
......@@ -56,6 +56,61 @@ package body Ocarina.Python_Cmd is
package ATNP renames Ocarina.ME_AADL.AADL_Tree.Nodes.Python;
package AINP renames Ocarina.ME_AADL.AADL_Instances.Nodes.Python;
procedure Get_Node_Id (Data : in out Callback_Data'Class; N : String);
procedure Get_Property_Value (Data : in out Callback_Data'Class;
PropId : String; PropName : String);
procedure Get_Property_Value_By_Name (Data : in out Callback_Data'Class;
PropId : String; PropName : String);
------------------------
-- Get_Property_Value --
------------------------
procedure Get_Property_Value (Data : in out Callback_Data'Class;
PropId : String; PropName : String)
is
Result : constant String_List :=
Ocarina.Backends.Properties.Utils.Check_And_Get_Property
(Get_Node_Id_From_String (PropId),
Get_Node_Id_From_String (PropName));
begin
Set_Return_Value_As_List (Data);
for Elt of Result loop
Set_Return_Value (Data, Elt.all);
end loop;
end Get_Property_Value;
--------------------------------
-- Get_Property_Value_By_Name --
--------------------------------
procedure Get_Property_Value_By_Name (Data : in out Callback_Data'Class;
PropId : String; PropName : String)
is
Result : constant String_List :=
Ocarina.Backends.Properties.Utils.Check_And_Get_Property
(Get_Node_Id_From_String (PropId),
Get_String_Name (PropName));
begin
Set_Return_Value_As_List (Data);
for Elt of Result loop
Set_Return_Value (Data, Elt.all);
end loop;
end Get_Property_Value_By_Name;
-----------------
-- Get_Node_Id --
-----------------
procedure Get_Node_Id (Data : in out Callback_Data'Class;
N : String) is
begin
Set_Return_Value (Data, Integer'Image (Integer
(Namet.Get_String_Name (N))));
end Get_Node_Id;
--------------
-- On_Reset --
--------------
......
......@@ -29,8 +29,6 @@
-- --
------------------------------------------------------------------------------
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Errors; use Errors;
with Locations; use Locations;
with Ocarina.Namet; use Ocarina.Namet;
......@@ -46,7 +44,6 @@ with Ocarina.Instances; use Ocarina.Instances;
with Ocarina.Parser; use Ocarina.Parser;
with Ocarina.Options; use Ocarina.Options;
with Ocarina.Files; use Ocarina.Files;
with Ocarina.Backends.Properties.Utils;
package body Ocarina.Utils is
......@@ -181,55 +178,6 @@ package body Ocarina.Utils is
return AADL_Root;
end Get_AADL_Root;
------------------------
-- Get_Property_Value --
------------------------
procedure Get_Property_Value (Data : in out Callback_Data'Class;
PropId : String; PropName : String)
is
Result : constant String_List :=
Ocarina.Backends.Properties.Utils.Check_And_Get_Property
(Get_Node_Id_From_String (PropId),
Get_Node_Id_From_String (PropName));
begin
Set_Return_Value_As_List (Data);
for Elt of Result loop
Set_Return_Value (Data, Elt.all);
end loop;
end Get_Property_Value;
--------------------------------
-- Get_Property_Value_By_Name --
--------------------------------
procedure Get_Property_Value_By_Name (Data : in out Callback_Data'Class;
PropId : String; PropName : String)
is
Result : constant String_List :=
Ocarina.Backends.Properties.Utils.Check_And_Get_Property
(Get_Node_Id_From_String (PropId),
Get_String_Name (PropName));
begin
Set_Return_Value_As_List (Data);
for Elt of Result loop
Set_Return_Value (Data, Elt.all);
end loop;
end Get_Property_Value_By_Name;
-----------------
-- Get_Node_Id --
-----------------
procedure Get_Node_Id (Data : in out Callback_Data'Class;
N : String) is
begin
Set_Return_Value (Data, Integer'Image (Integer
(Namet.Get_String_Name (N))));
end Get_Node_Id;
-----------------------------
-- Get_Node_Id_From_String --
-----------------------------
......
......@@ -29,11 +29,7 @@
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
with Ocarina.Types; use Ocarina.Types;
with GNATCOLL.Scripts; use GNATCOLL.Scripts;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
package Ocarina.Utils is
......@@ -55,10 +51,4 @@ package Ocarina.Utils is
function Get_Int_From_String (Name : String) return Int;
function Get_Value_Id_From_String (Name : String) return Value_Id;
procedure Get_Node_Id (Data : in out Callback_Data'Class; N : String);
procedure Get_Property_Value (Data : in out Callback_Data'Class;
PropId : String; PropName : String);
procedure Get_Property_Value_By_Name (Data : in out Callback_Data'Class;
PropId : String; PropName : String);
end Ocarina.Utils;
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