Commit f4efd10f authored by yoogx's avatar yoogx

* Instantiate: return a boolean

        For issue #30
parent 15d663e9
...@@ -129,8 +129,11 @@ package body Ocarina.Python_Cmd is ...@@ -129,8 +129,11 @@ package body Ocarina.Python_Cmd is
Command : String) Command : String)
is is
pragma Unreferenced (Command); pragma Unreferenced (Command);
Result : constant Boolean :=
Ocarina.Utils.Instantiate (Nth_Arg (Data, 1, ""));
begin begin
Ocarina.Utils.Instantiate (Nth_Arg (Data, 1, "")); Set_Return_Value (Data, Result);
end On_Instantiate; end On_Instantiate;
---------------------- ----------------------
......
...@@ -222,7 +222,8 @@ package body Ocarina.Utils is ...@@ -222,7 +222,8 @@ package body Ocarina.Utils is
-- Instantiate -- -- Instantiate --
----------------- -----------------
procedure Instantiate (Root_System : String) is function Instantiate (Root_System : String) return Boolean is
Success : Boolean;
begin begin
if Root_System /= "" then if Root_System /= "" then
Root_System_Name := To_Lower Root_System_Name := To_Lower
...@@ -231,7 +232,12 @@ package body Ocarina.Utils is ...@@ -231,7 +232,12 @@ package body Ocarina.Utils is
AADL_Root := Instantiate_Model (AADL_Root); AADL_Root := Instantiate_Model (AADL_Root);
if Present (AADL_Root) then if Present (AADL_Root) then
Write_Line ("Model instantiated sucessfully"); Write_Line ("Model instantiated sucessfully");
Success := True;
else
Success := False;
end if; end if;
return Success;
end Instantiate; end Instantiate;
-------------- --------------
......
...@@ -48,7 +48,7 @@ package Ocarina.Utils is ...@@ -48,7 +48,7 @@ package Ocarina.Utils is
procedure Load_AADL_File (Filename : String); procedure Load_AADL_File (Filename : String);
function Analyze return Boolean; function Analyze return Boolean;
procedure Instantiate (Root_System : String); function Instantiate (Root_System : String) return Boolean;
procedure Generate (Backend_Name : String); procedure Generate (Backend_Name : String);
procedure Reset; procedure Reset;
......
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