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