Commit dd7f358e authored by yoogx's avatar yoogx
Browse files

* Minor reformatting

parent 9dd73496
...@@ -147,7 +147,7 @@ package Ocarina.Backends.Ada_Tree.Nutils is ...@@ -147,7 +147,7 @@ package Ocarina.Backends.Ada_Tree.Nutils is
Tok_Dot_Dot, -- .. Tok_Dot_Dot, -- ..
Tok_Minus_Minus -- -- Tok_Minus_Minus -- --
); );
Token_Image : array (Token_Type) of Name_Id; Token_Image : array (Token_Type) of Name_Id;
......
...@@ -119,25 +119,30 @@ package body Ocarina.Backends.Alloy is ...@@ -119,25 +119,30 @@ package body Ocarina.Backends.Alloy is
-- of the corresponding instance name -- of the corresponding instance name
if Present (Parent_Subcomponent (E)) then if Present (Parent_Subcomponent (E)) then
Put_Line (FD, "one sig " & Put_Line
(FD,
"one sig " &
To_Lower To_Lower
(Get_Name_String (Get_Name_String
(Normalize_Name (Normalize_Name (Fully_Qualified_Instance_Name (E)))) &
(Fully_Qualified_Instance_Name (E)))) " extends Component{}{");
& " extends Component{}{");
else else
Put_Line (Kind (E)'Img); Put_Line (Kind (E)'Img);
Root_System_Name := Normalize_Name Root_System_Name := Normalize_Name (Display_Name (Identifier (E)));
(Display_Name (Identifier (E)));
Put_Line (FD, "one sig " & Put_Line
To_Lower (Get_Name_String (Root_System_Name)) (FD,
& " extends Component{}{"); "one sig " &
To_Lower (Get_Name_String (Root_System_Name)) &
" extends Component{}{");
end if; end if;
Put_Line (FD, ASCII.HT & "type=" Put_Line
& Get_Name_String (Category_Name_String (Category))); (FD,
ASCII.HT &
"type=" &
Get_Name_String (Category_Name_String (Category)));
-- Rule #2: list subcomponents -- Rule #2: list subcomponents
...@@ -173,18 +178,17 @@ package body Ocarina.Backends.Alloy is ...@@ -173,18 +178,17 @@ package body Ocarina.Backends.Alloy is
if Present (AIN.Properties (E)) then if Present (AIN.Properties (E)) then
T := First_Node (AIN.Properties (E)); T := First_Node (AIN.Properties (E));
while Present (T) loop while Present (T) loop
Put (FD, Put
(FD,
To_Lower To_Lower
(Get_Name_String (Get_Name_String
(Normalize_Name (Normalize_Name (Display_Name (Identifier (T))))));
(Display_Name
(Identifier (T))))));
T := Next_Node (T); T := Next_Node (T);
if Present (T) then if Present (T) then
Put (FD, "+"); Put (FD, "+");
end if; end if;
end loop; end loop;
New_Line (Fd); New_Line (FD);
else else
Put_Line (FD, "none"); Put_Line (FD, "none");
...@@ -255,8 +259,9 @@ package body Ocarina.Backends.Alloy is ...@@ -255,8 +259,9 @@ package body Ocarina.Backends.Alloy is
-- Add global contract -- Add global contract
New_Line (FD); New_Line (FD);
Put_Line (FD, "// Declaration of the contract(s) " Put_Line
& "representing the model(s)"); (FD,
"// Declaration of the contract(s) " & "representing the model(s)");
New_Line (FD); New_Line (FD);
Put_Line (FD, "one sig aadl_model extends Contract{}{"); Put_Line (FD, "one sig aadl_model extends Contract{}{");
Put_Line (FD, ASCII.HT & "assumption=none"); Put_Line (FD, ASCII.HT & "assumption=none");
...@@ -277,8 +282,10 @@ package body Ocarina.Backends.Alloy is ...@@ -277,8 +282,10 @@ package body Ocarina.Backends.Alloy is
if Present (Subcomponents (E)) then if Present (Subcomponents (E)) then
T := First_Node (Subcomponents (E)); T := First_Node (Subcomponents (E));
while Present (T) loop while Present (T) loop
Print_Subcomponents := Print_Subcomponents Print_Subcomponents :=
and then (Get_Category_Of_Component (T) = CC_System Print_Subcomponents
and then
(Get_Category_Of_Component (T) = CC_System
or else Get_Category_Of_Component (T) = CC_Device or else Get_Category_Of_Component (T) = CC_Device
or else Get_Category_Of_Component (T) = CC_Bus); or else Get_Category_Of_Component (T) = CC_Bus);
T := Next_Node (T); T := Next_Node (T);
...@@ -288,7 +295,7 @@ package body Ocarina.Backends.Alloy is ...@@ -288,7 +295,7 @@ package body Ocarina.Backends.Alloy is
-- We are in case a), generate all subcomponents of root system -- We are in case a), generate all subcomponents of root system
if Print_Subcomponents then if Print_Subcomponents then
Put (Fd, ASCII.HT & "output="); Put (FD, ASCII.HT & "output=");
if Present (Subcomponents (E)) then if Present (Subcomponents (E)) then
T := First_Node (Subcomponents (E)); T := First_Node (Subcomponents (E));
while Present (T) loop while Present (T) loop
...@@ -316,8 +323,11 @@ package body Ocarina.Backends.Alloy is ...@@ -316,8 +323,11 @@ package body Ocarina.Backends.Alloy is
else else
-- We are in case b), generate only root system -- We are in case b), generate only root system
Put_Line (FD, ASCII.HT & "output=" Put_Line
& To_Lower (Get_Name_String (Root_System_Name))); (FD,
ASCII.HT &
"output=" &
To_Lower (Get_Name_String (Root_System_Name)));
end if; end if;
end; end;
......
...@@ -402,7 +402,8 @@ package body Ocarina.Backends.ASN1_Tree.Nutils is ...@@ -402,7 +402,8 @@ package body Ocarina.Backends.ASN1_Tree.Nutils is
Name := Name_Find; Name := Name_Find;
Name := Add_Suffix_To_Name (Keyword_Suffix, Name); Name := Add_Suffix_To_Name (Keyword_Suffix, Name);
Set_Name_Table_Byte Set_Name_Table_Byte
(Name, Ocarina.Types.Byte (Token_Type'Pos (T) + 1)); (Name,
Ocarina.Types.Byte (Token_Type'Pos (T) + 1));
Set_Str_To_Name_Buffer (Image (T)); Set_Str_To_Name_Buffer (Image (T));
else else
......
...@@ -1576,8 +1576,8 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1576,8 +1576,8 @@ package body Ocarina.Backends.Build_Utils is
Write_Line ("prove:"); Write_Line ("prove:");
Write_Line Write_Line
(ASCII.HT & (ASCII.HT &
"gnatprove -P$(PROJECT_FILE) -XTARGET=SPARK " "gnatprove -P$(PROJECT_FILE) -XTARGET=SPARK " &
& "--warnings=continue --report=fail"); "--warnings=continue --report=fail");
end if; end if;
-- Close the file -- Close the file
......
...@@ -1996,8 +1996,7 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -1996,8 +1996,7 @@ package body Ocarina.Backends.C_Common.Mapping is
CTU.Make_Parameter_Specification CTU.Make_Parameter_Specification
(Defining_Identifier => (Defining_Identifier =>
Map_C_Defining_Identifier (F), Map_C_Defining_Identifier (F),
Parameter_Type => Parameter_Type => Map_C_Data_Type_Designator (D));
Map_C_Data_Type_Designator (D));
else else
Param := Param :=
CTU.Make_Parameter_Specification CTU.Make_Parameter_Specification
...@@ -2019,9 +2018,7 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -2019,9 +2018,7 @@ package body Ocarina.Backends.C_Common.Mapping is
Field := AIN.First_Node (Subcomponents (D)); Field := AIN.First_Node (Subcomponents (D));
while Present (Field) loop while Present (Field) loop
if AINU.Is_Data if AINU.Is_Data (Corresponding_Instance (Field)) then
(Corresponding_Instance (Field))
then
if Mode = Mode_In then if Mode = Mode_In then
Param := Param :=
CTU.Make_Parameter_Specification CTU.Make_Parameter_Specification
...@@ -2038,8 +2035,7 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -2038,8 +2035,7 @@ package body Ocarina.Backends.C_Common.Mapping is
Parameter_Type => Parameter_Type =>
Make_Pointer_Type Make_Pointer_Type
(Map_C_Data_Type_Designator (Map_C_Data_Type_Designator
(Corresponding_Instance (Corresponding_Instance (Field))));
(Field))));
end if; end if;
CTU.Append_Node_To_List (Param, Profile); CTU.Append_Node_To_List (Param, Profile);
end if; end if;
...@@ -3042,8 +3038,8 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -3042,8 +3038,8 @@ package body Ocarina.Backends.C_Common.Mapping is
-- Port Name have to be the same. -- Port Name have to be the same.
-- --
if Get_Connection_Pattern (E) = Inter_Process and then if Get_Connection_Pattern (E) = Inter_Process
POK_Flavor = DEOS and then POK_Flavor = DEOS
then then
Get_Name_String (Display_Name (Identifier (E))); Get_Name_String (Display_Name (Identifier (E)));
N := Name_Find; N := Name_Find;
......
...@@ -799,9 +799,7 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -799,9 +799,7 @@ package body Ocarina.Backends.C_Common.Types is
False), False),
True); True);
end if; end if;
elsif Get_Concurrency_Protocol (E) = elsif Get_Concurrency_Protocol (E) = Priority_Ceiling then
Priority_Ceiling
then
-- Protected type that does not have struct members. -- Protected type that does not have struct members.
-- This piece of code is made to handle declaration -- This piece of code is made to handle declaration
...@@ -1000,8 +998,8 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1000,8 +998,8 @@ package body Ocarina.Backends.C_Common.Types is
elsif AINU.Is_Process (Corresponding_Instance (C)) then elsif AINU.Is_Process (Corresponding_Instance (C)) then
if Present (Subcomponents (Corresponding_Instance (C))) then if Present (Subcomponents (Corresponding_Instance (C))) then
S := First_Node S :=
(Subcomponents (Corresponding_Instance (C))); First_Node (Subcomponents (Corresponding_Instance (C)));
while Present (S) loop while Present (S) loop
Visit_Component_Instance (Corresponding_Instance (S)); Visit_Component_Instance (Corresponding_Instance (S));
S := Next_Node (S); S := Next_Node (S);
...@@ -1120,8 +1118,8 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1120,8 +1118,8 @@ package body Ocarina.Backends.C_Common.Types is
if AINU.Is_Process (Parent) and then Parent /= E then if AINU.Is_Process (Parent) and then Parent /= E then
if Present (Extra_Item (Src)) if Present (Extra_Item (Src))
and then Present (Get_Provided_Virtual_Bus_Class and then Present
(Extra_Item (Src))) (Get_Provided_Virtual_Bus_Class (Extra_Item (Src)))
then then
Visit Visit
(Get_Provided_Virtual_Bus_Class (Get_Provided_Virtual_Bus_Class
......
...@@ -1007,7 +1007,8 @@ package body Ocarina.Backends.C_Tree.Nutils is ...@@ -1007,7 +1007,8 @@ package body Ocarina.Backends.C_Tree.Nutils is
Name := Name_Find; Name := Name_Find;
Name := Add_Suffix_To_Name (Keyword_Suffix, Name); Name := Add_Suffix_To_Name (Keyword_Suffix, Name);
Set_Name_Table_Byte Set_Name_Table_Byte
(Name, Ocarina.Types.Byte (Token_Type'Pos (T) + 1)); (Name,
Ocarina.Types.Byte (Token_Type'Pos (T) + 1));
Set_Str_To_Name_Buffer (Image (T)); Set_Str_To_Name_Buffer (Image (T));
else else
...@@ -1665,8 +1666,7 @@ package body Ocarina.Backends.C_Tree.Nutils is ...@@ -1665,8 +1666,7 @@ package body Ocarina.Backends.C_Tree.Nutils is
if not AINU.Is_Empty (AIN.Features (Spg)) then if not AINU.Is_Empty (AIN.Features (Spg)) then
F := AIN.First_Node (AIN.Features (Spg)); F := AIN.First_Node (AIN.Features (Spg));
while Present (F) loop while Present (F) loop
if Kind (F) = K_Subcomponent_Access_Instance if Kind (F) = K_Subcomponent_Access_Instance then
then
-- This case is specific to POK since we don't -- This case is specific to POK since we don't
-- handle the shared data with the same patterns as -- handle the shared data with the same patterns as
-- in PolyORB-HI-C. This could be updated later. -- in PolyORB-HI-C. This could be updated later.
...@@ -1675,8 +1675,7 @@ package body Ocarina.Backends.C_Tree.Nutils is ...@@ -1675,8 +1675,7 @@ package body Ocarina.Backends.C_Tree.Nutils is
if Data_Accessed = No_Node then if Data_Accessed = No_Node then
Display_Located_Error Display_Located_Error
(AIN.Loc (F), (AIN.Loc (F),
"is not properly conected to" & "is not properly conected to" & " any source",
" any source",
Fatal => True); Fatal => True);
end if; end if;
......
...@@ -235,8 +235,7 @@ package body Ocarina.Backends.Cheddar.Mapping is ...@@ -235,8 +235,7 @@ package body Ocarina.Backends.Cheddar.Mapping is
Concurrency_Protocols : constant array Concurrency_Protocols : constant array
(Supported_Concurrency_Control_Protocol'Range) of Name_Id := (Supported_Concurrency_Control_Protocol'Range) of Name_Id :=
(None_Specified => Get_String_Name ("NO_PROTOCOL"), (None_Specified => Get_String_Name ("NO_PROTOCOL"),
Priority_Ceiling => Priority_Ceiling => Get_String_Name ("PRIORITY_CEILING_PROTOCOL"),
Get_String_Name ("PRIORITY_CEILING_PROTOCOL"),
others => No_Name); others => No_Name);
begin begin
......
...@@ -361,8 +361,8 @@ package body Ocarina.Backends.Connection_Matrix.Main is ...@@ -361,8 +361,8 @@ package body Ocarina.Backends.Connection_Matrix.Main is
Bandwidth := Bandwidth :=
Get_Integer_Property Get_Integer_Property
(Conn, (Conn,
"bus_properties:" "bus_properties:" &
& ":required_bandwidth"); ":required_bandwidth");
Bandwidth_Unit := Bandwidth_Unit :=
ATN.Name ATN.Name
...@@ -370,9 +370,8 @@ package body Ocarina.Backends.Connection_Matrix.Main is ...@@ -370,9 +370,8 @@ package body Ocarina.Backends.Connection_Matrix.Main is
(Get_Value_Of_Property_Association (Get_Value_Of_Property_Association
(Conn, (Conn,
Get_String_Name Get_String_Name
("bus_properties:" ("bus_properties:" &
& ":required_bandwidth" ":required_bandwidth"))));
))));
Connected := True; Connected := True;
end if; end if;
end if; end if;
......
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