Commit 16405607 authored by jhugues's avatar jhugues
Browse files

* Add support for abstract features



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2658 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 36d69797
......@@ -90,6 +90,8 @@ package body Ocarina.BE_AADL.Components.Connections is
Print_Tokens ((T_Event, T_Port));
when CT_Event_Data =>
Print_Tokens ((T_Event, T_Data, T_Port));
when CT_Feature =>
Print_Token (T_Feature);
when CT_Feature_Group =>
case AADL_Version is
when AADL_V1 =>
......
......@@ -158,10 +158,14 @@ package body Ocarina.BE_AADL.Components.Features is
Write_Space;
end if;
if Is_Data (Node) then
Print_Token (T_Data);
Write_Space;
Print_Token (T_Port);
if Is_Data (Node) or else Is_Feature (Node) then
if Is_Data (Node) then
Print_Token (T_Data);
Write_Space;
Print_Token (T_Port);
elsif Is_Feature (Node) then
Print_Token (T_Feature);
end if;
if Present (Class_Ref) then
Write_Space;
......
......@@ -635,8 +635,7 @@ package body Ocarina.Instances.Properties is
begin
if No (Property_Value) then
-- If there is no property value defined, simply return
return Instantiated_Value;
return No_Node;
end if;
case ATN.Kind (Property_Value) is
......
......@@ -193,6 +193,8 @@ package body Ocarina.Analyzer.AADL.Queries is
return PO_Event_Data_Port_Connections;
when CT_Parameter =>
return PO_Parameter_Connections;
when CT_Feature =>
return PO_Feature;
when CT_Feature_Group =>
case AADL_Version is
when AADL_V1 =>
......
......@@ -299,12 +299,10 @@ package body Ocarina.Analyzer.AADL.Semantics is
(Property, Entity_Of_Property);
end if;
if Success then
return True;
else
if not Success then
Display_Property_Not_Applicable (Property, Entity_Of_Property);
return False;
end if;
return Success;
end Check_Applies_To;
----------------------------------------------
......@@ -699,6 +697,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
Success := False;
when CT_Port_Connection
| CT_Feature
| CT_Access_Subprogram_Group
| CT_Access_Virtual_Bus
| CT_Access =>
......@@ -1033,6 +1032,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
Success := False;
when CT_Port_Connection
| CT_Feature
| CT_Access_Subprogram_Group
| CT_Access_Virtual_Bus
| CT_Access =>
......
......@@ -150,6 +150,7 @@ package body Ocarina.Builder.AADL.Components.Features is
Is_Out : Boolean;
Is_Data : Boolean;
Is_Event : Boolean;
Is_Feature : Boolean;
Is_Refinement : Boolean := False;
Associated_Entity : Node_Id := No_Node)
return Node_Id
......@@ -173,6 +174,8 @@ package body Ocarina.Builder.AADL.Components.Features is
Set_Is_Out (Node, Is_Out);
Set_Is_Data (Node, Is_Data);
Set_Is_Event (Node, Is_Event);
Set_Is_Feature (Node, Is_Feature);
Set_Entity_Ref (Node, Associated_Entity);
-- We only create an inversed feature for in or out features
......
......@@ -49,6 +49,7 @@ package Ocarina.Builder.AADL.Components.Features is
Is_Out : Boolean;
Is_Data : Boolean;
Is_Event : Boolean;
Is_Feature : Boolean;
Is_Refinement : Boolean := False;
Associated_Entity : Node_Id := No_Node)
return Node_Id;
......
......@@ -426,6 +426,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
boolean Is_Out;
// FIXME: Replace the two flags above by a Mode_Id flag
boolean Is_Feature;
boolean Is_Event; // FIXME: Rename to Is_Event_Port
boolean Is_Data; // FIXME: Rename to Is_Data_Port
};
......
......@@ -88,6 +88,7 @@ package Ocarina.ME_AADL is
-- AADL_V2
CT_Access_Virtual_Bus,
CT_Feature,
CT_Port_Connection,
CT_Access_Subprogram_Group,
CT_Access);
......
......@@ -338,14 +338,15 @@ package body Ocarina.FE_AADL.Parser.Components.Connections is
Code := PC_Feature_Group_Connection;
end if;
Save_Lexer (Loc);
Scan_Token;
if Token /= T_Group then
DPE (Code, T_Group);
Skip_Tokens (T_Semicolon);
return No_Node;
Category := CT_Feature;
Restore_Lexer (Loc);
else
Category := CT_Feature_Group;
end if;
Category := CT_Feature_Group;
else
DPE (PC_Feature_Group_Connection, EMC_Not_Allowed_In_AADL_V1);
Skip_Tokens (T_Semicolon);
......@@ -535,6 +536,7 @@ package body Ocarina.FE_AADL.Parser.Components.Connections is
| CT_Port_Connection
| CT_Event_Data
| CT_Event
| CT_Feature
| CT_Feature_Group =>
In_Modes := P_In_Modes (PC_In_Modes_And_Transitions);
......
......@@ -125,7 +125,7 @@ package body Ocarina.FE_AADL.Parser.Components.Features is
end if;
case Token is
when T_Data | T_Event =>
when T_Data | T_Event | T_Feature =>
if Code = PC_Parameter or else Code = PC_Parameter_Refinement then
DPE (Code, T_Parameter);
Skip_Tokens (T_Semicolon);
......@@ -273,6 +273,7 @@ package body Ocarina.FE_AADL.Parser.Components.Features is
Port_Spec : Node_Id := No_Node;
Is_Data : Boolean := False;
Is_Event : Boolean := False;
Is_Feature : Boolean := False;
Code : Parsing_Code;
OK : Boolean;
Loc : Location;
......@@ -293,21 +294,28 @@ package body Ocarina.FE_AADL.Parser.Components.Features is
else
Restore_Lexer (Loc);
end if;
elsif Token = T_Data then
Is_Data := True;
elsif Token = T_Feature then
Is_Feature := True;
else
DPE (PC_Port_Type, ((T_Event, T_Data)));
return No_Node;
end if;
Scan_Token;
if not Is_Feature then
Scan_Token;
if Token /= T_Port then
DPE (PC_Port_Type, T_Port);
return No_Node;
if Token /= T_Port then
DPE (PC_Port_Type, T_Port);
return No_Node;
end if;
end if;
if Is_Data then
if Is_Data or else Is_Feature then
Save_Lexer (Loc);
Scan_Token;
if Token = T_Identifier then
......@@ -331,6 +339,7 @@ package body Ocarina.FE_AADL.Parser.Components.Features is
Is_Out => Is_Out,
Is_Event => Is_Event,
Is_Data => Is_Data,
Is_Feature => Is_Feature,
Is_Refinement => Is_Refinement,
Associated_Entity => Class_Ref);
......@@ -682,6 +691,7 @@ package body Ocarina.FE_AADL.Parser.Components.Features is
end if;
Scan_Token;
case Token is
when T_In | T_Out =>
Node := P_In_Out_Item (Container, Identifier, Is_Refinement, Code);
......
......@@ -1569,6 +1569,7 @@ package body Ocarina.Transfo.Fusions is
Is_In (Src_Feat),
Is_Out (Src_Feat),
Is_Data (Src_Feat),
Is_Feature (Src_Feat),
True);
else
......@@ -1664,6 +1665,7 @@ package body Ocarina.Transfo.Fusions is
Is_In (Src_Feat),
Is_Out (Src_Feat),
Is_Data (Src_Feat),
Is_Feature (Src_Feat),
True);
else
......@@ -1748,6 +1750,7 @@ package body Ocarina.Transfo.Fusions is
Is_In (Dst_Feat),
Is_Out (Dst_Feat),
Is_Data (Dst_Feat),
Is_Feature (Dst_Feat),
True);
else
......@@ -1835,6 +1838,7 @@ package body Ocarina.Transfo.Fusions is
Is_In (Dst_Feat),
Is_Out (Dst_Feat),
Is_Data (Dst_Feat),
Is_Feature (Dst_Feat),
True);
else
......
......@@ -642,6 +642,7 @@ package body Ocarina.Transfo.Move is
Is_Out => Is_Out (Dst),
Is_Data => Is_Data (Dst),
Is_Event => Is_Event (Dst),
Is_Feature => Is_Feature (Dst),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (New_Port) then
......@@ -862,6 +863,7 @@ package body Ocarina.Transfo.Move is
Is_Out => False,
Is_Data => Is_Data (Src_Port),
Is_Event => Is_Event (Src_Port),
Is_Feature => Is_Feature (Src_Port),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (Src_P) then
......@@ -887,6 +889,7 @@ package body Ocarina.Transfo.Move is
Is_Out => True,
Is_Data => Is_Data (Src_Port),
Is_Event => Is_Event (Src_Port),
Is_Feature => Is_Feature (Src_Port),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (Dst_P) then
......@@ -1328,6 +1331,7 @@ package body Ocarina.Transfo.Move is
Is_Out => Is_Out (Src),
Is_Data => Is_Data (Src),
Is_Event => Is_Event (Src),
Is_Feature => Is_Feature (Src),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (New_Port) then
......@@ -1519,7 +1523,7 @@ package body Ocarina.Transfo.Move is
(Features
(Corresponding_Entity
(Component_Type_Identifier
(Src_Process_Impl))),
(Src_Process_Impl))),
Src_Port_Name);
Src_P := Add_New_Port_Spec
......@@ -1533,6 +1537,7 @@ package body Ocarina.Transfo.Move is
Is_Out => True,
Is_Data => Is_Data (Src_Port),
Is_Event => Is_Event (Src_Port),
Is_Feature => Is_Feature (Src_Port),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (Src_P) then
......@@ -1559,6 +1564,7 @@ package body Ocarina.Transfo.Move is
Is_Out => False,
Is_Data => Is_Data (Src_Port),
Is_Event => Is_Event (Src_Port),
Is_Feature => Is_Feature (Src_Port),
Is_Refinement => False,
Associated_Entity => Data_E);
if No (Dst_P) then
......
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