Commit 7fcc2015 authored by jhugues's avatar jhugues

* Report an error instead of raising an exception in case of multiple candidates for a root system

	For TASTE ticket #361



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@6909 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 639ec60f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. -- -- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2013 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify -- -- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the -- -- it under terms of the GNU General Public License as published by the --
...@@ -183,7 +183,7 @@ package body Ocarina.Instances is ...@@ -183,7 +183,7 @@ package body Ocarina.Instances is
else else
Error_Loc (1) := No_Location; Error_Loc (1) := No_Location;
DE ("Cannot select a root system among several "); DE ("Please select a root system among ");
List_Node := Root_Systems.First; List_Node := Root_Systems.First;
while Present (List_Node) loop while Present (List_Node) loop
Error_Loc (1) := ATN.Loc (List_Node); Error_Loc (1) := ATN.Loc (List_Node);
...@@ -191,6 +191,7 @@ package body Ocarina.Instances is ...@@ -191,6 +191,7 @@ package body Ocarina.Instances is
DE ("%"); DE ("%");
List_Node := ATN.Next_Entity (List_Node); List_Node := ATN.Next_Entity (List_Node);
end loop; end loop;
Exit_On_Error (True, "Cannot instantiate AADL model");
end if; end if;
else else
...@@ -210,6 +211,7 @@ package body Ocarina.Instances is ...@@ -210,6 +211,7 @@ package body Ocarina.Instances is
Error_Name (2) := ATE.Get_Name_Of_Entity (List_Node); Error_Name (2) := ATE.Get_Name_Of_Entity (List_Node);
DE ("system % is not a root system, use %"); DE ("system % is not a root system, use %");
Root_System := No_Node; Root_System := No_Node;
Exit_On_Error (True, "Cannot instantiate AADL model");
end if; end if;
end if; end if;
...@@ -219,6 +221,7 @@ package body Ocarina.Instances is ...@@ -219,6 +221,7 @@ package body Ocarina.Instances is
if No (Root_System) then if No (Root_System) then
Instance_Root := No_Node; Instance_Root := No_Node;
Exit_On_Error (True, "Cannot instantiate full model, exit now");
else else
-- The first step of the instantiation consist of propagate the -- The first step of the instantiation consist of propagate the
-- properties declared in the AADL packages to the AADL -- properties declared in the AADL packages to the AADL
......
...@@ -281,3 +281,4 @@ tests/example_04_03/t.aadl ...@@ -281,3 +281,4 @@ tests/example_04_03/t.aadl
tests/example_04_05_1/t.aadl tests/example_04_05_1/t.aadl
tests/github/issue_1/test.aadl tests/github/issue_1/test.aadl
tests/root_system/test.aadl
AADL_VERSION=-aadlv2
OCARINA_FLAGS=-i
\ No newline at end of file
package p1
public
system r1
end r1;
system implementation r1.i
end r1.i;
system r2
end r2;
system implementation r2.i
end r2.i;
end p1;
ocarina: Cannot select a root system among several
test.aadl:13:01: r2.i
test.aadl:7:01: r1.i
Cannot instantiate full model, exit now
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