Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kazoo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
kazoo
Commits
19971e5e
Commit
19971e5e
authored
Aug 28, 2019
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get the list of ACN files in DataView.aadl
parent
e5eb40e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
4 deletions
+87
-4
src/taste-data_view.adb
src/taste-data_view.adb
+23
-2
src/taste-data_view.ads
src/taste-data_view.ads
+3
-2
test/Demo_ACN/DataView.aadl
test/Demo_ACN/DataView.aadl
+54
-0
test/Demo_ACN/OtherDV.acn
test/Demo_ACN/OtherDV.acn
+3
-0
test/Demo_ACN/OtherDV.asn
test/Demo_ACN/OtherDV.asn
+4
-0
No files found.
src/taste-data_view.adb
View file @
19971e5e
...
@@ -40,6 +40,7 @@ package body TASTE.Data_View is
...
@@ -40,6 +40,7 @@ package body TASTE.Data_View is
use
ASN1_File_Maps
;
use
ASN1_File_Maps
;
System
:
Node_Id
;
System
:
Node_Id
;
Files
:
ASN1_File_Maps
.
Map
;
Files
:
ASN1_File_Maps
.
Map
;
ACN_Files
:
String_Sets
.
Set
;
Current_Type
:
Node_Id
;
Current_Type
:
Node_Id
;
F
:
Name_Id
;
F
:
Name_Id
;
Loc
:
Location
;
Loc
:
Location
;
...
@@ -94,10 +95,26 @@ package body TASTE.Data_View is
...
@@ -94,10 +95,26 @@ package body TASTE.Data_View is
Module
:
constant
String
:=
Get_Name_String
Module
:
constant
String
:=
Get_Name_String
(
Get_String_Property
(
Asntype
,
(
Get_String_Property
(
Asntype
,
Get_String_Name
(
"taste::ada_package_name"
)));
Get_String_Name
(
"taste::ada_package_name"
)));
ACN_Ref
:
constant
Node_Id
:=
Get_Classifier_Property
(
Asntype
,
"taste::encodingdefinitionfile"
);
Filename
:
constant
String
:=
Get_Name_String
Filename
:
constant
String
:=
Get_Name_String
(
Get_Source_Text
(
Asntype
)
(
1
));
(
Get_Source_Text
(
Asntype
)
(
1
));
File_Ref
:
constant
ASN1_File_Maps
.
Cursor
:=
Files
.
Find
(
Filename
);
File_Ref
:
constant
ASN1_File_Maps
.
Cursor
:=
Files
.
Find
(
Filename
);
begin
begin
-- If there are ACN files, add them to the list
if
ACN_Ref
/=
No_Node
then
declare
ACN
:
constant
Name_Array
:=
Get_Source_Text
(
ACN_Ref
);
use
String_Sets
;
begin
for
F
of
ACN
loop
ACN_Files
.
Union
(
To_Set
(
Get_Name_String
(
F
)));
end
loop
;
end
;
end
if
;
if
File_Ref
=
ASN1_File_Maps
.
No_Element
then
if
File_Ref
=
ASN1_File_Maps
.
No_Element
then
declare
declare
New_File
:
ASN1_File
;
New_File
:
ASN1_File
;
...
@@ -111,7 +128,7 @@ package body TASTE.Data_View is
...
@@ -111,7 +128,7 @@ package body TASTE.Data_View is
end
if
;
end
if
;
New_File
.
Path
:=
Relative_Path
;
New_File
.
Path
:=
Relative_Path
;
New_File
.
Modules
.
Insert
(
Module
,
New_Module
);
New_File
.
Modules
.
Insert
(
Module
,
New_Module
);
Files
.
Insert
(
Filename
,
New_File
);
Files
.
Insert
(
Filename
,
New_File
);
end
;
end
;
else
else
declare
declare
...
@@ -133,7 +150,8 @@ package body TASTE.Data_View is
...
@@ -133,7 +150,8 @@ package body TASTE.Data_View is
end
;
end
;
Current_Type
:=
AIN
.
Next_Node
(
Current_Type
);
Current_Type
:=
AIN
.
Next_Node
(
Current_Type
);
end
loop
;
end
loop
;
return
Data_AST
:
constant
Taste_Data_View
:=
(
ASN1_Files
=>
Files
);
return
Data_AST
:
constant
Taste_Data_View
:=
(
ASN1_Files
=>
Files
,
ACN_Files
=>
ACN_Files
);
end
Parse_Data_View
;
end
Parse_Data_View
;
-- Function checking the actual file presence of the ASN.1 models that
-- Function checking the actual file presence of the ASN.1 models that
...
@@ -168,6 +186,9 @@ package body TASTE.Data_View is
...
@@ -168,6 +186,9 @@ package body TASTE.Data_View is
end
loop
;
end
loop
;
end
loop
;
end
loop
;
end
loop
;
end
loop
;
for
Each
of
DV
.
ACN_Files
loop
Put_Line
(
Output
,
"ACN File : "
&
Each
);
end
loop
;
end
Debug_Dump
;
end
Debug_Dump
;
procedure
Export_ASN1_Files
(
DV
:
Taste_Data_View
;
Output_Path
:
String
)
is
procedure
Export_ASN1_Files
(
DV
:
Taste_Data_View
;
Output_Path
:
String
)
is
...
...
src/taste-data_view.ads
View file @
19971e5e
...
@@ -48,14 +48,15 @@ package TASTE.Data_View is
...
@@ -48,14 +48,15 @@ package TASTE.Data_View is
type
ASN1_File
is
type
ASN1_File
is
record
record
Path
:
Unbounded_String
;
Path
:
Unbounded_String
;
Modules
:
ASN1_Module_Maps
.
Map
;
Modules
:
ASN1_Module_Maps
.
Map
;
end
record
;
end
record
;
package
ASN1_File_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
type
Taste_Data_View
is
tagged
record
record
ASN1_Files
:
ASN1_File_Maps
.
Map
;
ASN1_Files
:
ASN1_File_Maps
.
Map
;
ACN_Files
:
String_Sets
.
Set
;
end
record
;
end
record
;
function
Parse_Data_View
(
Dataview_Root
:
Node_Id
)
return
Taste_Data_View
function
Parse_Data_View
(
Dataview_Root
:
Node_Id
)
return
Taste_Data_View
...
...
test/Demo_ACN/DataView.aadl
View file @
19971e5e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
--
! File generated by asn2aadl v2.1.39: DO NOT EDIT !
--
! File generated by asn2aadl v2.1.39: DO NOT EDIT !
--------------------------------------------------------
--------------------------------------------------------
--
! InputASN1FileChecksum:ea2bc8085f96189ce53191fc48545a34:/home/taste/tool-src/kazoo/test/Demo_ACN/DataView.asn:
--
! InputASN1FileChecksum:ea2bc8085f96189ce53191fc48545a34:/home/taste/tool-src/kazoo/test/Demo_ACN/DataView.asn:
--
! InputASN1FileChecksum:93fd79217d8801a03cc8aa8ad4a5170a:/home/taste/tool-src/kazoo/test/Demo_ACN/OtherDV.asn:
--
! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:/home/taste/tool-inst/share/taste-types/taste-types.asn:
--
! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:/home/taste/tool-inst/share/taste-types/taste-types.asn:
--------------------------------------------------------
--------------------------------------------------------
...
@@ -40,6 +41,52 @@ data Stream_Element_Buffer
...
@@ -40,6 +41,52 @@ data Stream_Element_Buffer
properties
properties
Data_Model
::
Data_Representation
=>
Character
;
Data_Model
::
Data_Representation
=>
Character
;
end
Stream_Element_Buffer
;
end
Stream_Element_Buffer
;
DATA
FooBar
PROPERTIES
--
name
of
the
ASN
.1
source
file
:
Source_Text
=>
(
"/home/taste/tool-src/kazoo/test/Demo_ACN/OtherDV.asn"
);
TASTE
::
EncodingDefinitionFile
=>
classifier
(
DataView
::
ACN_OtherDV
);
TASTE
::
Ada_Package_Name
=>
"Other"
;
Deployment
::
ASN1_Module_Name
=>
"Other"
;
Source_Language
=>
(
ASN1
);
--
Size
of
a
buffer
to
cover
all
forms
of
message
representation
:
--
Real
message
size
is
1
;
suggested
aligned
message
buffer
is
...
Source_Data_Size
=>
8
Bytes
;
--
name
of
the
corresponding
data
type
in
the
source
file
:
Type_Source_Name
=>
"FooBar"
;
TASTE
::
Position_In_File
=>
[
line
=>
3
;
column
=>
1
;
];
--
what
kind
of
type
is
this
?
TASTE
::
ASN1_Basic_Type
=>
aBOOLEAN
;
END
FooBar
;
DATA
IMPLEMENTATION
FooBar
.
impl
END
FooBar
.
impl
;
DATA
FooBar_Buffer_Max
END
FooBar_Buffer_Max
;
DATA
IMPLEMENTATION
FooBar_Buffer_Max
.
impl
--
Buffer
to
hold
a
marshalled
data
of
type
FooBar
PROPERTIES
Data_Model
::
Data_Representation
=>
array
;
Data_Model
::
Dimension
=>
(
8
);
--
Size
of
the
buffer
Source_Data_Size
=>
8
Bytes
;
--
Size
of
the
buffer
in
bytes
Data_Model
::
Base_Type
=>
(
classifier
(
DataView
::
Stream_Element_Buffer
));
END
FooBar_Buffer_Max
.
impl
;
DATA
FooBar_Buffer
END
FooBar_Buffer
;
DATA
IMPLEMENTATION
FooBar_Buffer
.
impl
--
Buffer
to
hold
a
marshalled
data
of
type
FooBar
SUBCOMPONENTS
Buffer
:
data
FooBar_Buffer_Max
.
impl
;
Length
:
data
Base_Types
::
Unsigned_32
;
PROPERTIES
Data_Model
::
Data_Representation
=>
Struct
;
Source_Data_Size
=>
24
Bytes
;
--
Size
of
the
buffer
in
bytes
END
FooBar_Buffer
.
impl
;
DATA
T_Boolean
DATA
T_Boolean
PROPERTIES
PROPERTIES
--
name
of
the
ASN
.1
source
file
:
--
name
of
the
ASN
.1
source
file
:
...
@@ -316,6 +363,7 @@ END Taste_DataView;
...
@@ -316,6 +363,7 @@ END Taste_DataView;
SYSTEM
IMPLEMENTATION
Taste_DataView
.
others
SYSTEM
IMPLEMENTATION
Taste_DataView
.
others
SUBCOMPONENTS
SUBCOMPONENTS
FooBar
:
DATA
FooBar
.
impl
;
T_Boolean
:
DATA
T_Boolean
.
impl
;
T_Boolean
:
DATA
T_Boolean
.
impl
;
T_Int32
:
DATA
T_Int32
.
impl
;
T_Int32
:
DATA
T_Int32
.
impl
;
T_Int8
:
DATA
T_Int8
.
impl
;
T_Int8
:
DATA
T_Int8
.
impl
;
...
@@ -329,4 +377,10 @@ PROPERTIES
...
@@ -329,4 +377,10 @@ PROPERTIES
Source_Language
=>
(
ACN
);
Source_Language
=>
(
ACN
);
END
ACN_DataView
;
END
ACN_DataView
;
DATA
ACN_OtherDV
PROPERTIES
Source_Text
=>
(
"/home/taste/tool-src/kazoo/test/Demo_ACN/OtherDV.acn"
);
Source_Language
=>
(
ACN
);
END
ACN_OtherDV
;
end
DataView
;
end
DataView
;
test/Demo_ACN/OtherDV.acn
0 → 100644
View file @
19971e5e
Other DEFINITIONS ::= BEGIN
FooBar[size 4, true-value '0101'B]
END
test/Demo_ACN/OtherDV.asn
0 → 100644
View file @
19971e5e
Other DEFINITIONS ::=
BEGIN
FooBar ::= BOOLEAN
END
Write
Preview
Markdown
is supported
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