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
6c9a4567
Commit
6c9a4567
authored
Mar 14, 2018
by
Maxime Perrotin
Browse files
Add checking function for ASN.1 file presence
parent
690de90d
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/taste-aadl_parser.adb
View file @
6c9a4567
...
...
@@ -151,6 +151,7 @@ package body TASTE.AADL_Parser is
if
Result
.
Configuration
.
Data_View
.
all
'
Length
>
0
then
begin
Result
.
Data_View
:=
Parse_Data_View
(
Dataview_root
);
Result
.
Data_View
.
Check_Files
;
exception
when
Constraint_Error
=>
raise
Data_View_Error
with
"Update your data view!"
;
...
...
src/taste-data_view.adb
View file @
6c9a4567
...
...
@@ -4,7 +4,8 @@
-- Interface View parser
with
Locations
,
with
Ada
.
Directories
,
Locations
,
Ocarina
.
Instances
.
Queries
,
Ocarina
.
Analyzer
,
Ocarina
.
Backends
.
Properties
,
...
...
@@ -119,6 +120,25 @@ package body TASTE.Data_View is
return
Data_AST
:
constant
Taste_Data_View
:=
(
ASN1_Files
=>
Files
);
end
Parse_Data_View
;
-- Function checking the actual file presence of the ASN.1 models that
-- are referenced in the input file DataView.aadl. Raise an exception
-- if any file is missing.
procedure
Check_Files
(
DV
:
Taste_Data_View
)
is
Success
:
Boolean
:=
True
;
begin
for
Each
of
DV
.
ASN1_Files
loop
if
not
Ada
.
Directories
.
Exists
(
To_String
(
Each
.
Path
))
then
Put_Error
(
"File not found: "
&
To_String
(
Each
.
Path
));
Success
:=
False
;
end
if
;
end
loop
;
if
not
Success
then
raise
Data_View_Error
with
"ASN.1 files missing (wrong path in DataView.aadl). "
&
"Run taste-update-data-view [list of ASN.1 files]"
;
end
if
;
end
Check_Files
;
procedure
Debug_Dump
(
DV
:
Taste_Data_View
;
Output
:
File_Type
)
is
begin
for
Each
of
DV
.
ASN1_Files
loop
...
...
src/taste-data_view.ads
View file @
6c9a4567
...
...
@@ -58,7 +58,9 @@ package TASTE.Data_View is
end
record
;
function
Parse_Data_View
(
Dataview_Root
:
Node_Id
)
return
Taste_Data_View
with
Pre
=>
Dataview_Root
/=
No_Node
;
with
Pre
=>
Dataview_Root
/=
No_Node
;
procedure
Check_Files
(
DV
:
Taste_Data_View
);
procedure
Debug_Dump
(
DV
:
Taste_Data_View
;
Output
:
File_Type
);
...
...
src/taste-parser_version.ads
View file @
6c9a4567
package
TASTE
.
Parser_Version
is
Parser_Release
:
constant
String
:=
"
c7a88bb
; Commit Date: Mon Mar 12 21:
34:55
2018 "
;
"
690de90
; Commit Date: Mon Mar 12 21:
50:07
2018 "
;
Ocarina_Version
:
constant
String
:=
"Ocarina 2017.x (Working Copy from r
c50d
39
4
)"
;
"Ocarina 2017.x (Working Copy from r
61c0f
39)"
;
end
TASTE
.
Parser_Version
;
\ No newline at end of file
test/test3/Makefile
View file @
6c9a4567
...
...
@@ -2,11 +2,11 @@ AADL_PARSER=../../aadl_parser
all
:
test-parse
test-parse
:
test-parse
:
clean
$(AADL_PARSER)
-o
output
-i
InterfaceView.aadl
-d
DataView.aadl ../common/TASTE_IV_Properties.aadl
clean
:
rm
-rf
o
bj
$(exec)
*
~
rm
-rf
o
utput
.PHONY
:
clean test-parse
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