Commit e71f49e9 authored by Bechir Zalila's avatar Bechir Zalila

* (ocarina-be_aadl-namespaces.adb, ocarina-be_aadl-annexes.adb): When

	dumping AADL code, dump annex libraries as well.

	* (ocarina-be_aadl-components-modes.adb): Handle mode properly the
	display of mode transition triggers by a recursive procedure because
	they can be quite complex.
parent 0f7baaea
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 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- --
......@@ -64,9 +64,13 @@ package body Ocarina.BE_AADL.Annexes is
procedure Print_Annex_Subclause (Node : Node_Id) is
Content : constant Node_Id := Annex_Content (Node);
In_Mode : constant Node_Id := In_Modes (Node);
In_Mode : Node_Id := In_Modes (Node);
begin
if Kind (Node) = K_Annex_Subclause then
In_Mode := In_Modes (Node);
end if;
Write_Indentation;
Print_Token (T_Annex);
Write_Space;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 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- --
......@@ -43,6 +43,38 @@ package body Ocarina.BE_AADL.Components.Modes is
use Ocarina.ME_AADL.AADL_Tree.Nutils;
use Ocarina.BE_AADL.Identifiers;
procedure Print_Trigger (Node : Node_Id);
-- Displays a mode transition trigger
-------------------
-- Print_Trigger --
-------------------
procedure Print_Trigger (Node : Node_Id) is
begin
case Kind (Node) is
when K_Entity_Reference =>
Print_Entity_Reference (Node);
when K_Identifier =>
Print_Identifier (Node);
when K_Mode_Transition_Trigger =>
if Ocarina.ME_AADL.AADL_Tree.Nodes.Is_Self (Node) then
Print_Token (T_Self);
Print_Token (T_Dot);
elsif Ocarina.ME_AADL.AADL_Tree.Nodes.Is_Processor (Node) then
Print_Token (T_Processor);
Print_Token (T_Dot);
end if;
Print_Trigger (Identifier (Node));
when others =>
raise Program_Error
with "Error when displaying a mode transition trigger";
end case;
end Print_Trigger;
--------------------
-- Print_In_Modes --
--------------------
......@@ -158,25 +190,7 @@ package body Ocarina.BE_AADL.Components.Modes is
Write_Space;
end if;
if Ocarina.ME_AADL.AADL_Tree.Nodes.Kind (List_Node) =
K_Entity_Reference
then
Print_Entity_Reference (List_Node);
elsif Ocarina.ME_AADL.AADL_Tree.Nodes.Kind (List_Node) =
K_Mode_Transition_Trigger
then
if Ocarina.ME_AADL.AADL_Tree.Nodes.Is_Self (List_Node) then
Print_Token (T_Self);
Print_Token (T_Dot);
elsif Ocarina.ME_AADL.AADL_Tree.Nodes.Is_Processor
(List_Node)
then
Print_Token (T_Processor);
Print_Token (T_Dot);
end if;
Print_Identifier
(Ocarina.ME_AADL.AADL_Tree.Nodes.Identifier (List_Node));
end if;
Print_Trigger (List_Node);
List_Node := Next_Node (List_Node);
end loop;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 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- --
......@@ -234,6 +234,9 @@ package body Ocarina.BE_AADL.Namespaces is
when K_Name_Visibility_Declaration =>
Print_Name_Visibility_Declaration (List_Node);
when K_Annex_Library =>
Print_Annex_Library (List_Node);
when others =>
raise Program_Error;
end case;
......
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