Commit 6db4c5bc authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Minor code cleanup

parent 2d5f7ec6
...@@ -46,12 +46,12 @@ procedure AADL_Parser is ...@@ -46,12 +46,12 @@ procedure AADL_Parser is
Deployment_root : Node_Id := No_Node; Deployment_root : Node_Id := No_Node;
Dataview_root : Node_ID := No_Node; Dataview_root : Node_ID := No_Node;
Success : Boolean; Success : Boolean;
-- OutDir : Integer := 0; -- OutDir : Natural := 0;
-- Stack_Val : Integer := 0; -- Stack_Val : Natural := 0;
-- Timer_Resolution : Integer := 0; -- Timer_Resolution : Natural := 0;
Interface_View : Integer := 0; Interface_View : Natural := 0;
Depl_View_Pos : Integer := 0; Depl_View_Pos : Natural := 0;
Data_View : Integer := 0; Data_View : Natural := 0;
Generate_glue : Boolean := false; Generate_glue : Boolean := false;
AADL_Version : AADL_Version_Type := Ocarina.AADL_V2; AADL_Version : AADL_Version_Type := Ocarina.AADL_V2;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
with Ada.Text_IO, with Ada.Text_IO,
Ada.Exceptions, Ada.Exceptions,
Ada.Strings.Fixed,
System.Assertions, System.Assertions,
-- Ada.Command_Line, -- Ada.Command_Line,
Ocarina.Instances.Queries, Ocarina.Instances.Queries,
...@@ -26,6 +27,7 @@ package body Deployment_View is ...@@ -26,6 +27,7 @@ package body Deployment_View is
use Ada.Text_IO, use Ada.Text_IO,
Ada.Exceptions, Ada.Exceptions,
Ada.Strings.Fixed,
System.Assertions, System.Assertions,
Ocarina.Instances.Queries, Ocarina.Instances.Queries,
Ocarina.Namet, Ocarina.Namet,
...@@ -97,7 +99,7 @@ package body Deployment_View is ...@@ -97,7 +99,7 @@ package body Deployment_View is
function Parse_Bus (Elem : Node_Id; Bus : Node_Id) return Taste_Bus is function Parse_Bus (Elem : Node_Id; Bus : Node_Id) return Taste_Bus is
Properties : constant Property_Maps.Map := Get_Properties_Map (CI); Properties : constant Property_Maps.Map := Get_Properties_Map (CI);
Classifier : Name_Id := No_Name; Classifier : Name_Id;
Pkg_Name : Name_Id := No_Name; Pkg_Name : Name_Id := No_Name;
begin begin
Set_Str_To_Name_Buffer (""); Set_Str_To_Name_Buffer ("");
...@@ -116,6 +118,7 @@ package body Deployment_View is ...@@ -116,6 +118,7 @@ package body Deployment_View is
Classifier := Name_Find; Classifier := Name_Find;
else else
Classifier := Name (Identifier (Bus)); Classifier := Name (Identifier (Bus));
-- No "default" Pkg_Name?
end if; end if;
return Taste_Bus'(Name => return Taste_Bus'(Name =>
US (Get_Name_String (Name (Identifier (Elem)))), US (Get_Name_String (Name (Identifier (Elem)))),
...@@ -212,11 +215,11 @@ package body Deployment_View is ...@@ -212,11 +215,11 @@ package body Deployment_View is
function Parse_Device (CI : Node_Id) return Taste_Device_Driver is function Parse_Device (CI : Node_Id) return Taste_Device_Driver is
Result : Taste_Device_Driver; Result : Taste_Device_Driver;
Pkg_Name : Name_Id := No_Name; Pkg_Name : Name_Id;
Accessed_Bus : Node_Id := No_Node; Accessed_Bus : Node_Id;
Accessed_Port : Node_Id := No_Node; Accessed_Port : Node_Id;
Device_Implementation : Node_Id := No_Node; Device_Implementation : Node_Id;
Configuration_Data : Node_Id := No_Node; Configuration_Data : Node_Id;
begin begin
Result.Name := US (Get_Name_String (Name (Identifier (CI)))); Result.Name := US (Get_Name_String (Name (Identifier (CI))));
...@@ -246,10 +249,11 @@ package body Deployment_View is ...@@ -246,10 +249,11 @@ package body Deployment_View is
end if; end if;
for Index in ST'Range loop for Index in ST'Range loop
Get_Name_String (ST (Index)); Get_Name_String (ST (Index));
if Name_Buffer (Name_Len - 3 .. Name_Len) = ".asn" if Tail (Source => Name_Buffer (1 .. Name_Len),
Count => 4) = ".asn"
then then
Result.ASN1_Filename := US (Get_Name_String Result.ASN1_Filename :=
(Get_String_Name (Name_Buffer (1 .. Name_Len)))); US (Name_Buffer (1 .. Name_Len));
end if; end if;
end loop; end loop;
end; end;
......
...@@ -126,7 +126,7 @@ package body Interface_View is ...@@ -126,7 +126,7 @@ package body Interface_View is
--------------------------- ---------------------------
function Get_ASN1_Module_Name (D : Node_Id) return String is function Get_ASN1_Module_Name (D : Node_Id) return String is
id : Name_Id := No_Name; id : Name_Id;
ASN1_Module : constant Name_id := ASN1_Module : constant Name_id :=
Get_String_Name ("deployment::asn1_module_name"); Get_String_Name ("deployment::asn1_module_name");
begin begin
...@@ -494,7 +494,7 @@ package body Interface_View is ...@@ -494,7 +494,7 @@ package body Interface_View is
Result : Taste_Terminal_Function; Result : Taste_Terminal_Function;
-- To get the optional zip filename where user code is stored: -- To get the optional zip filename where user code is stored:
Source_Text : constant Name_Array := Get_Source_Text (Inst); Source_Text : constant Name_Array := Get_Source_Text (Inst);
Zip_Id : Name_Id := No_Name; Zip_Id : Name_Id;
-- To get the context parameters -- To get the context parameters
Subco : Node_Id; Subco : Node_Id;
-- To get the provided and required interfaces -- To get the provided and required interfaces
......
package Parser_Version is package Parser_Version is
Parser_Release : constant String := Parser_Release : constant String :=
"a3aa44d ; Commit Date: Tue Dec 5 21:56:09 2017 "; "2d5f7ec ; Commit Date: Wed Dec 6 18:21:43 2017 ";
Ocarina_Version : constant String := Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from r0b92ed3)"; "Ocarina 2017.x (Working Copy from r0b92ed3)";
end Parser_Version; end Parser_Version;
\ No newline at end of file
Supports Markdown
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