Commit e380f7bc authored by hugues.jerome's avatar hugues.jerome

* Solve various issues related to the parsing and analysis of

	  properties applied to access components; and bad interaction
	  between the AADLv1 and AADLv2 case



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@821 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent b978a4c6
......@@ -939,15 +939,17 @@ package body Ocarina.Analyzer.AADL.Queries is
(Subcomponent_Category (Entity));
end if;
-- Only access property names can be applied to subcomponent
-- accesses.
if AADL_Version = AADL_V1 then
-- AADLV1 only: access property names can be applied to
-- subcomponent accesses.
if Kind (Entity) = K_Subcomponent_Access
and then not Is_Access (Property_Name)
then
-- No need to go further, it cannot apply
if Kind (Entity) = K_Subcomponent_Access
and then not Is_Access (Property_Name)
then
-- No need to go further, it cannot apply
return False;
return False;
end if;
end if;
-- Check if the property can be applied to the entity
......@@ -958,13 +960,24 @@ package body Ocarina.Analyzer.AADL.Queries is
while List_Node /= No_Node and then not Success loop
case Category_Of_Property_Owner is
when PO_Component_Category =>
-- Here, we check that the component (or an access
-- to this component matches on of the
-- corresponding component types or meta model
-- elements in the 'applies to'
Can_Apply :=
(Named_Element'Val (Category (List_Node)) =
PO_Component_Category)
PO_Component_Category
or else
Named_Element'Val (Category (List_Node)) =
PO_Component_Access)
and then
(Category_Of_Component =
Component_Category'Val (Component_Cat (List_Node)));
-- XXX dubious, here we erase the previously
-- computed value of Can_Apply, to be investigated.
if Present (Classifier_Ref (List_Node)) then
if Present (Corresponding_Component) then
Can_Apply := Is_An_Extension
......
......@@ -206,6 +206,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
or else Kind (Container) = K_Component_Implementation
or else Kind (Container) = K_Feature_Group_Type
or else Kind (Container) = K_Subcomponent
or else Kind (Container) = K_Subcomponent_Access
or else Kind (Container) = K_Port_Spec
or else Kind (Container) = K_Parameter
or else Kind (Container) = K_Connection);
......@@ -238,6 +239,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
Name (Namespace_Identifier (Qualified_Reference))
then
Success := True;
elsif Kind (Qualified_Reference) = K_Identifier
and then Name (Identifier (Pack_Container)) =
Name (Qualified_Reference)
......@@ -256,7 +258,6 @@ package body Ocarina.Analyzer.AADL.Semantics is
end if;
return Success;
end Check_Qualified_References;
----------------------
......
......@@ -280,7 +280,9 @@ package body Ocarina.FE_AADL.Parser.Properties is
return No_Node;
end case;
else
if Property_Type = PAT_Access then
if AADL_Version = AADL_V1
and then Property_Type = PAT_Access
then
if Is_Constant then
DPE (Code, T_Access);
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