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