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

* Minor reformatting



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1483 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent a368f8ee
......@@ -206,7 +206,6 @@ package body Ocarina.Backends.C_Common.Subprograms is
S := First_Node (Features (E));
while Present (S) loop
Visit (Corresponding_Instance (S));
S := Next_Node (S);
......@@ -404,12 +403,14 @@ package body Ocarina.Backends.C_Common.Subprograms is
-- Visit the component instance corresponding to the
-- subcomponent S.
if Get_Current_Backend_Kind = PolyORB_Kernel_C
and then Get_Category_Of_Component
(Corresponding_Instance (S)) = CC_Process then
and then Get_Category_Of_Component
(Corresponding_Instance (S)) = CC_Process
then
null;
else
if Get_Category_Of_Component
(Corresponding_Instance (S)) /= CC_Device then
(Corresponding_Instance (S)) /= CC_Device
then
Visit (Corresponding_Instance (S));
end if;
end if;
......@@ -439,8 +440,8 @@ package body Ocarina.Backends.C_Common.Subprograms is
if Kind (Feature) = K_Port_Spec_Instance
and then Is_In (Feature)
and then Is_Event (Feature)
and then not Is_Data (Feature) then
and then not Is_Data (Feature)
then
if Get_Port_Compute_Entrypoint (Feature) /= No_Node then
Visit (Get_Port_Compute_Entrypoint (Feature));
end if;
......
......@@ -806,34 +806,32 @@ package body Ocarina.Backends.C_Common.Types is
Start_Recording_Handlings;
if Get_Current_Backend_Kind = PolyORB_Kernel_C and then
not AINU.Is_Empty (Subcomponents (E)) then
if Get_Current_Backend_Kind = PolyORB_Kernel_C
and then not AINU.Is_Empty (Subcomponents (E))
then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
if AINU.Is_Data (Corresponding_Instance (S)) and then
Is_Protected_Data (Corresponding_Instance (S)) then
if AINU.Is_Data (Corresponding_Instance (S))
and then Is_Protected_Data (Corresponding_Instance (S))
then
Add_Include (PKR.RH (RH_Deployment));
if POK_Flavor = ARINC653 then
Declaration := Make_Extern_Entity_Declaration
(Make_Variable_Declaration
(Make_Defining_Identifier
(Map_Associated_Locking_Entity_Name
(S)),
PKR.RE (RE_Semaphore_Id_Type)));
(Map_Associated_Locking_Entity_Name (S)),
PKR.RE (RE_Semaphore_Id_Type)));
else
Declaration := Make_Extern_Entity_Declaration
(Make_Variable_Declaration
(Make_Defining_Identifier
(Map_Associated_Locking_Entity_Name
(S)),
PKR.RE (RE_Pok_Sem_Id_T)));
(Map_Associated_Locking_Entity_Name (S)),
PKR.RE (RE_Pok_Sem_Id_T)));
end if;
Append_Node_To_List
......
......@@ -1663,7 +1663,7 @@ package body Ocarina.Backends.C_Tree.Nutils is
Hybrid : constant Boolean :=
AINU.Is_Subprogram (Caller) and then
Properties.Get_Subprogram_Kind (Caller) =
Properties.Subprogram_Hybrid_Ada_95;
Properties.Subprogram_Hybrid_Ada_95; -- XXX why Ada ?
begin
-- The lists have to be created
......
......@@ -659,7 +659,7 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
if CCP /= Concurrency_Priority_Ceiling then
Display_Located_Error
(Loc (E),
"Incompatoble concurrency protocol, "
"Incompatible concurrency protocol, "
& "PolyORB-HI/Ada requires "
& "Priority_Ceiling",
True);
......
......@@ -1507,7 +1507,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
N := Make_Variable_Declaration
(Map_C_Defining_Identifier (S),
Map_C_Data_Type_Designator
(Corresponding_Instance (S)));
(Corresponding_Instance (S)));
Append_Node_To_List
(Make_Extern_Entity_Declaration (N),
......
......@@ -285,11 +285,11 @@ package body Ocarina.Instances.Components.Subprogram_Calls is
return No_Node;
end if;
end;
else
Display_No_Entity_Ref (New_Instance);
return No_Node;
end if;
end Instantiate_Subprogram_Call;
----------------------------------------
......@@ -316,14 +316,16 @@ package body Ocarina.Instances.Components.Subprogram_Calls is
New_Subinstance := Instantiate_Component
(Instance_Root,
Corresponding_Declaration
(Corresponding_Instance (Call_Instance)));
(Corresponding_Instance (Call_Instance)));
if Present (New_Subinstance) then
Set_Corresponding_Instance (Call_Instance, New_Subinstance);
return Call_Instance;
else
return No_Node;
end if;
else
return Call_Instance;
end if;
......
......@@ -48,10 +48,10 @@ package body Ocarina.Instances.Queries is
use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.ME_AADL.AADL_Tree.Entities.Properties;
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package AIEP renames Ocarina.ME_AADL.AADL_Instances.Entities.Properties;
package ATE renames Ocarina.ME_AADL.AADL_Tree.Entities;
package ATE renames Ocarina.ME_AADL.AADL_Tree.Entities;
-------------------------------------
-- Compute_Absolute_Name_Of_Entity --
......@@ -125,14 +125,10 @@ package body Ocarina.Instances.Queries is
begin
return Present (AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode));
Property_Name => Name,
In_Mode => In_Mode));
end Is_Defined_Property;
-------------------------
-- Is_Defined_Property --
-------------------------
function Is_Defined_Property
(Entity : Node_Id;
Name : String;
......@@ -143,10 +139,8 @@ package body Ocarina.Instances.Queries is
begin
Set_Str_To_Name_Buffer (Name);
Name2 := Name_find;
return Present (AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name2,
In_Mode => In_Mode));
return Is_Defined_Property (Entity, Name2, In_Mode);
end Is_Defined_Property;
----------------------------
......@@ -154,20 +148,24 @@ package body Ocarina.Instances.Queries is
----------------------------
function Compute_Property_Value (Property_Value : Node_Id) return Node_Id is
pragma Assert (ATN.Kind (Property_Value) = K_Property_Value);
Property_Expression : Node_Id;
begin
if Expanded_Single_Value (Property_Value) /= No_Node then
Property_Expression := Expanded_Single_Value (Property_Value);
elsif Expanded_Multi_Value (Property_Value) /= No_List then
Property_Expression :=
ATN.First_Node (Expanded_Multi_Value (Property_Value));
elsif Single_Value (Property_Value) /= No_Node then
Property_Expression := Single_Value (Property_Value);
elsif Multi_Value (Property_Value) /= No_List then
Property_Expression := ATN.First_Node (Multi_Value (Property_Value));
else
Property_Expression := No_Node;
end if;
......@@ -258,11 +256,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Name_Id
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value
(Property_Value, True) = PT_Enumeration
......@@ -286,11 +283,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Long_Long_Float
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_Float
or else Get_Type_Of_Property_Value
......@@ -315,11 +311,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Unsigned_Long_Long
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_Integer
or else Get_Type_Of_Property_Value
......@@ -388,11 +383,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Node_Id
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value
(Property_Value, True) = PT_Classifier
......@@ -406,10 +400,6 @@ package body Ocarina.Instances.Queries is
end if;
end Get_Classifier_Property;
-----------------------------
-- Get_Classifier_Property --
-----------------------------
function Get_Classifier_Property
(Entity : Node_Id;
Name : String;
......@@ -432,17 +422,13 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Node_Id
is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode);
begin
if Property = No_Node then
return No_Node;
end if;
Property : constant Node_Id := Get_Property_Association
(Entity, Name, In_Mode);
if Get_Type_Of_Property (Property) /= PT_Range then
begin
if No (Property)
or else Get_Type_Of_Property (Property) /= PT_Range
then
return No_Node;
end if;
......@@ -459,12 +445,11 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return List_Id
is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode);
Property : constant Node_Id := Get_Property_Association
(Entity, Name, In_Mode);
begin
if not Type_Of_Property_Is_A_List
if No (Property)
or else not Type_Of_Property_Is_A_List
(ATE.Get_Referenced_Entity (AIN.Property_Name (Property)))
then
return No_List;
......@@ -473,10 +458,6 @@ package body Ocarina.Instances.Queries is
return Expanded_Multi_Value (AIN.Property_Association_Value (Property));
end Get_List_Property;
-----------------------
-- Get_List_Property --
-----------------------
function Get_List_Property
(Entity : Node_Id;
Name : String;
......@@ -497,11 +478,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return String
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value);
......@@ -513,21 +493,16 @@ package body Ocarina.Instances.Queries is
end if;
end Get_String_Property;
-------------------------
-- Get_String_Property --
-------------------------
function Get_String_Property
(Entity : Node_Id;
Name : Name_Id;
In_Mode : Name_Id := No_Name)
return Name_Id
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value);
......@@ -539,33 +514,18 @@ package body Ocarina.Instances.Queries is
end if;
end Get_String_Property;
-------------------------
-- Get_String_Property --
-------------------------
function Get_String_Property
(Entity : Node_Id;
Name : String;
In_Mode : Name_Id := No_Name)
return Name_Id
is
Property_Value : Node_Id;
Name2 : Name_Id;
begin
Set_Str_To_Name_Buffer (Name);
Name2 := Name_Find;
Property_Value := Get_Value_Of_Property_Association
(Entity, Name2, In_Mode);
if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value);
else
return No_Name;
end if;
else
return No_Name;
end if;
return Get_String_Property (Entity, Name2, In_Mode);
end Get_String_Property;
---------------------------------------
......@@ -578,17 +538,16 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Node_Id
is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode);
Property : constant Node_Id := Get_Property_Association
(Entity, Name, In_Mode);
Value : Node_Id := No_Node;
begin
if Property /= No_Node then
return Compute_Property_Value
if Present (Property) then
Value := Compute_Property_Value
(AIN.Property_Association_Value (Property));
else
return No_Node;
end if;
return Value;
end Get_Value_Of_Property_Association;
---------------------------------
......@@ -601,11 +560,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_Boolean;
end Is_Defined_Boolean_Property;
......@@ -620,11 +578,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_Enumeration;
end Is_Defined_Enumeration_Property;
......@@ -639,11 +596,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
(Get_Type_Of_Property_Value (Property_Value, True) = PT_Float
or else Get_Type_Of_Property_Value (Property_Value, True) =
......@@ -660,11 +616,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
(Get_Type_Of_Property_Value (Property_Value, True) = PT_Integer
or else Get_Type_Of_Property_Value (Property_Value, True) =
......@@ -681,11 +636,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_Reference;
end Is_Defined_Reference_Property;
......@@ -700,11 +654,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_Classifier;
end Is_Defined_Classifier_Property;
......@@ -719,10 +672,9 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode);
Property : constant Node_Id := Get_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property) and then
Get_Type_Of_Property_Value
......@@ -739,22 +691,14 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity),
Property_Name => Name,
In_Mode => In_Mode);
Property : constant Node_Id := Get_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property)
and then Type_Of_Property_Is_A_List
(ATE.Get_Referenced_Entity
(AIN.Property_Name
(Property)));
(ATE.Get_Referenced_Entity (AIN.Property_Name (Property)));
end Is_Defined_List_Property;
------------------------------
-- Is_Defined_List_Property --
------------------------------
function Is_Defined_List_Property
(Entity : Node_Id;
Name : String;
......@@ -775,13 +719,9 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name)
return Boolean
is
pragma Assert (Present (Entity));
Property_Value : Node_Id;
begin
Property_Value := Get_Value_Of_Property_Association
Property_Value : constant Node_Id := Get_Value_Of_Property_Association
(Entity, Name, In_Mode);
begin
return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_String;
end Is_Defined_String_Property;
......
......@@ -117,9 +117,9 @@ package body Ocarina.Me_AADL.AADL_Instances.Entities.Properties is
-- and its value corresponds to the name of one
-- element of the list.
if No (AIN.In_Modes (List_Node)) or else
AINU.Is_Empty (ATN.Modes (AIN.In_Modes (List_Node))) or else
In_Mode = No_Name
if No (AIN.In_Modes (List_Node))
or else AINU.Is_Empty (ATN.Modes (AIN.In_Modes (List_Node)))
or else In_Mode = No_Name
then
return List_Node;
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