Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
53a8b63f
Commit
53a8b63f
authored
Jan 27, 2018
by
Maxime Perrotin
Browse files
Merge branch 'master' of
https://gitrepos.estec.esa.int/taste/aadl-parser
parents
c2dd11ef
cfc1a54a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/taste-data_view.adb
View file @
53a8b63f
...
...
@@ -42,21 +42,21 @@ package body TASTE.Data_View is
Files
:
ASN1_Maps
.
Map
;
Current_Type
:
Node_Id
;
function
Parse_Type
(
Data_Type
:
Node_Id
)
return
ASN1_File
is
Asntype
:
constant
Node_Id
:=
Corresponding_Instance
(
Data_Type
);
Name
:
constant
String
:=
Get_Name_String
(
Get_Type_Source_Name
(
Asntype
));
begin
Put_Line
(
"Data type : "
&
AIN_Case
(
Data_Type
));
Put_Line
(
" |_"
&
Name
);
Put_Line
(
" |_ Module : "
&
Get_Name_String
(
Get_String_Property
(
Asntype
,
Get_String_Name
(
"taste::ada_package_name"
))));
Put_Line
(
" |_ File : "
&
Get_Name_String
(
Get_Source_Text
(
Asntype
)(
1
)));
return
ASN1_File
'(
Path
=>
US
(
Name
),
Modules
=>
String_Vectors
.
Empty_Vector
);
-- TODO
end
Parse_Type
;
--
function Parse_Type (Data_Type : Node_Id) return ASN1_File is
--
Asntype : constant Node_Id := Corresponding_Instance (Data_Type);
--
Name : constant String := Get_Name_String
--
(Get_Type_Source_Name (Asntype));
--
begin
--
Put_Line ("Data type : " & AIN_Case (Data_Type));
--
Put_Line (" |_" & Name);
--
Put_Line (" |_ Module : " & Get_Name_String
--
(Get_String_Property (Asntype,
--
Get_String_Name ("taste::ada_package_name"))));
--
Put_Line (" |_ File : " & Get_Name_String
--
(Get_Source_Text (Asntype)(1)));
--
return ASN1_File'(Path => US (Name),
--
Modules => String_Vectors.Empty_Vector); -- TODO
--
end Parse_Type;
F
:
Name_Id
;
Loc
:
Location
;
...
...
@@ -91,8 +91,39 @@ package body TASTE.Data_View is
raise
Data_View_Error
with
"Component is not a data type!"
;
end
if
;
declare
Type_File
:
constant
ASN1_File
:=
Parse_Type
(
Current_Type
);
Asntype
:
constant
Node_Id
:=
Corresponding_Instance
(
Data_Type
);
Sort
:
constant
String
:=
Get_Name_String
(
Get_Type_Source_Name
(
Asntype
));
Module
:
constant
String
:=
Get_Name_String
(
Get_String_Property
(
Asntype
,
Get_String_Name
(
"taste::ada_package_name"
)));
Filename
:
constant
String
:=
Get_Name_String
(
Get_Source_Text
(
Asntype
(
1
)));
-- Type_File : constant ASN1_File := Parse_Type (Current_Type);
begin
if
Files
.
Contains
(
Key
=>
Filename
)
then
declare
Current_File
:
ASN1_File
:=
Files
.
Element
(
Filename
);
begin
if
Current_File
.
Modules
.
Contains
(
Module
)
then
Current_File
.
Modules
.
Element
(
Module
).
Append
(
Sort
);
else
declare
Types
:
String_Vectors
.
Vector
;
begin
Types
.
Append
(
Sort
);
Current_File
.
Modules
.
Insert
(
Key
=>
Module
,
New_Item
=>
Types
);
end
;
end
if
;
end
;
else
declare
New_File
:
ASN1_File
;
begin
New_File
.
Path
:=
Filename
;
-- etc
Files
.
Insert
(
Key
=>
To_String
(
Type_File
.
Path
),
New_Item
=>
Type_File
);
Current_Type
:=
AIN
.
Next_Node
(
Current_Type
);
...
...
src/taste-data_view.ads
View file @
53a8b63f
...
...
@@ -36,16 +36,19 @@ package TASTE.Data_View is
"data_model.aadl"
&
"deployment.aadl"
;
package
ASN1_Module_Maps
is
new
Indefinite_Ordered_Maps
(
String
,
String_Vectors
.
Vector
);
type
ASN1_File
is
record
Path
:
Unbounded_String
;
Modules
:
String_Vectors
.
Vector
;
Modules
:
ASN1_Module_Maps
.
Map
;
end
record
;
package
ASN1_Maps
is
new
Indefinite_Ordered_Maps
(
String
,
ASN1_File
);
package
ASN1_
File_
Maps
is
new
Indefinite_Ordered_Maps
(
String
,
ASN1_File
);
type
Taste_Data_View
is
tagged
record
ASN1_Files
:
ASN1_Maps
.
Map
;
ASN1_Files
:
ASN1_
File_
Maps
.
Map
;
end
record
;
function
Parse_Data_View
(
Dataview_Root
:
Node_Id
)
return
Taste_Data_View
...
...
src/taste-parser_version.ads
View file @
53a8b63f
package
TASTE
.
Parser_Version
is
Parser_Release
:
constant
String
:=
"
89bf5a8
; Commit Date:
Wed
Jan 2
4
1
0:54:55
2018 "
;
"
f0618ef
; Commit Date:
Thu
Jan 2
5
1
4:24:31
2018 "
;
Ocarina_Version
:
constant
String
:=
"Ocarina 2017.x (Working Copy from r
0b92ed3
)"
;
"Ocarina 2017.x (Working Copy from r
d078c54
)"
;
end
TASTE
.
Parser_Version
;
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment