Commit 543888f2 authored by jhugues's avatar jhugues

* Allow annex subclause at package level, per AADL syntax

	rules	



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@5020 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 031190df
......@@ -68,14 +68,15 @@ package body Ocarina.Builder.AADL.Annexes is
pragma Assert (Annex_Name /= No_Node
and then Kind (Annex_Name) = K_Identifier);
pragma Assert (Namespace /= No_Node);
pragma Assert ((Annex_Kind = K_Annex_Subclause
and then (Kind (Namespace) = K_Component_Implementation
or else Kind (Namespace) = K_Component_Type
or else Kind (Namespace) =
K_Feature_Group_Type))
or else (Annex_Kind = K_Annex_Library
pragma Assert
((Annex_Kind = K_Annex_Subclause
and then (Kind (Namespace) = K_Component_Implementation
or else Kind (Namespace) = K_Package_Specification
or else Kind (Namespace) = K_Component_Type
or else Kind (Namespace) = K_Feature_Group_Type))
or else (Annex_Kind = K_Annex_Library
and then (Kind (Namespace) = K_Package_Specification
or else Kind (Namespace) = K_AADL_Specification)));
or else Kind (Namespace) = K_AADL_Specification)));
Node : constant Node_Id := New_Node (Annex_Kind, Loc);
Success : Boolean := True;
......@@ -83,18 +84,17 @@ package body Ocarina.Builder.AADL.Annexes is
Set_Identifier (Node, Annex_Name);
Set_Corresponding_Entity (Annex_Name, Node);
Set_Annex_Content (Node, No_Node);
Set_In_Modes (Node, In_Modes);
if Kind (Namespace) = K_AADL_Specification
or else Kind (Namespace) = K_Package_Specification
then
if Kind (Namespace) = K_AADL_Specification then
Set_Container_Package (Node, Namespace);
Success := Add_Declaration (Namespace, Node);
elsif Kind (Namespace) = K_Component_Type
or else Kind (Namespace) = K_Package_Specification
or else Kind (Namespace) = K_Component_Implementation
or else Kind (Namespace) = K_Feature_Group_Type
then
Set_In_Modes (Node, In_Modes);
Set_Container_Component (Node, Namespace);
Success := Add_Annex (Namespace, Node);
end if;
......
......@@ -51,6 +51,7 @@ package body Ocarina.Builder.AADL.Components is
use Ocarina.ME_AADL.AADL_Tree.Nutils;
pragma Assert (Kind (Component) = K_Component_Implementation
or else Kind (Component) = K_Package_Specification
or else Kind (Component) = K_Component_Type
or else Kind (Component) = K_Feature_Group_Type);
pragma Assert (Present (Annex));
......
......@@ -202,6 +202,8 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
Node_Id Package_Name;
Node_Id Parent;
List_Id Annexes;
};
// AADL_V2
......
......@@ -391,8 +391,7 @@ package body Ocarina.FE_AADL.Parser.Namespaces is
end if;
when T_Annex =>
Declaration := P_Annex_Library
(Package_Spec, Private_Declaration => Private_Declarations);
Declaration := P_Annex_Subclause (Package_Spec);
when others =>
Restore_Lexer (Loc);
......@@ -400,7 +399,9 @@ package body Ocarina.FE_AADL.Parser.Namespaces is
end case;
if Present (Declaration) then
Set_Is_Private (Declaration, Private_Declarations);
if Kind (Declaration) /= K_Annex_Subclause then
Set_Is_Private (Declaration, Private_Declarations);
end if;
Nb_Items := Nb_Items + 1;
else
......
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