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
9c0c9903
Commit
9c0c9903
authored
Sep 01, 2019
by
Maxime Perrotin
Browse files
Add some checks on the model
parent
4c39e52d
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
src/kazoo.adb
View file @
9c0c9903
with
GNAT
.
OS_Lib
,
with
Ada
.
Exceptions
,
GNAT
.
OS_Lib
,
TASTE
,
TASTE
.
AADL_Parser
,
TASTE
.
Parser_Utils
,
TASTE
.
Model_Transformations
,
TASTE
.
Dump
;
use
TASTE
.
AADL_Parser
,
TASTE
.
Parser_Utils
,
TASTE
.
Model_Transformations
;
procedure
Kazoo
is
...
...
@@ -28,4 +31,7 @@ begin
exception
when
TASTE
.
Quit_TASTE
=>
GNAT
.
OS_Lib
.
OS_Exit
(
1
);
when
Error
:
others
=>
Put_Error
(
Ada
.
Exceptions
.
Exception_Message
(
Error
));
GNAT
.
OS_Lib
.
OS_Exit
(
1
);
end
Kazoo
;
src/taste-aadl_parser.adb
View file @
9c0c9903
...
...
@@ -494,6 +494,15 @@ package body TASTE.AADL_Parser is
-- Find and set protected blocks calling threads
Set_Calling_Threads
(
Partition
);
-- Check that all blocks have a calling thread, otherwise
-- they will never run
for
B
of
Partition
.
Blocks
loop
if
B
.
Calling_Threads
.
Length
=
0
then
raise
Concurrency_View_Error
with
"Function "
&
To_String
(
B
.
Name
)
&
" has no active caller"
;
end
if
;
end
loop
;
-- Define ports at partition (process) level
-- (ports are for all interfaces of a function not located
-- in the same partition of the system)
...
...
src/taste-semantic_check.adb
View file @
9c0c9903
...
...
@@ -72,9 +72,19 @@ package body TASTE.Semantic_Check is
-- 1) interfaces must all have a parameter
-- 2) interfaces must all be sporadic (TODO)
if
Each
.
Language
=
"gui"
and
then
((
for
all
I
of
Each
.
Provided
=>
I
.
Params
.
Length
/=
1
)
or
else
(
for
all
I
of
Each
.
Required
=>
I
.
Params
.
Length
/=
1
))
((
Each
.
Provided
.
Length
>
0
and
then
(
for
all
I
of
Each
.
Provided
=>
I
.
Params
.
Length
/=
1
))
or
else
(
Each
.
Required
.
Length
>
0
and
then
(
for
all
I
of
Each
.
Required
=>
I
.
Params
.
Length
/=
1
)))
then
for
I
of
Each
.
Provided
loop
Put_Error
(
"PI "
&
To_String
(
I
.
Name
)
&
" has "
&
I
.
Params
.
Length
'
Img
&
" parameters"
);
end
loop
;
for
I
of
Each
.
Required
loop
Put_Error
(
"RI "
&
To_String
(
I
.
Name
)
&
" has "
&
I
.
Params
.
Length
'
Img
&
" parameters"
);
end
loop
;
raise
Semantic_Error
with
"Function "
&
To_String
(
Each
.
Name
)
&
"'s interfaces"
&
" must all have exactly one parameter"
;
...
...
templates/skeletons/gui-enum-defs/function.tmplt
View file @
9c0c9903
...
...
@@ -32,6 +32,7 @@
*/
#pragma once
@@IF@@ @_List_Of_ASync_PIs'Length_@ > 1 @@-- include "Poll"
typedef enum {
@@INLINE( )(,\n )()@@
@@TABLE@@
...
...
@@ -41,7 +42,9 @@ typedef enum {
@@END_TABLE@@
@@END_INLINE@@
} T_@_Name_@_PI_list;
@@END_IF@@
@@IF@@ @_List_Of_ASync_RIs'Length_@ > 0
typedef enum {
@@INLINE( )(,\n )()@@
@@TABLE@@
...
...
@@ -49,3 +52,4 @@ typedef enum {
@@END_TABLE@@
@@END_INLINE@@
} T_@_Name_@_RI_list;
@@END_IF@@
test/test-
tsp3
/DataView.aadl
→
test/test-
detect-no-active-caller
/DataView.aadl
View file @
9c0c9903
This diff is collapsed.
Click to expand it.
test/test-
tsp3
/DataView.asn
→
test/test-
detect-no-active-caller
/DataView.asn
View file @
9c0c9903
File moved
test/test-
tsp3
/DeploymentView.aadl
→
test/test-
detect-no-active-caller
/DeploymentView.aadl
View file @
9c0c9903
File moved
test/test-
tsp3
/InterfaceView.aadl
→
test/test-
detect-no-active-caller
/InterfaceView.aadl
View file @
9c0c9903
File moved
test/test-
tsp3
/Makefile
→
test/test-
detect-no-active-caller
/Makefile
View file @
9c0c9903
KAZOO
=
../../kazoo
all
:
test-parse
$(MAKE)
-C
output
test-parse
:
clean
$(KAZOO)
--gw
\
-o
output
\
-p
\
--glue
\
--no-stdlib
\
--debug
\
../common/libhw.aadl
../common/libhw.aadl
\
2>&1 |
tail
-1
| diff expected -
gdb
:
clean
gdb
--args
$(KAZOO)
--gw
\
-o
output
\
--glue
\
-o
output
\
--glue
\
-p
\
--no-stdlib
\
../common/libhw.aadl
\
--debug
--debug
clean
:
rm
-rf
output
...
...
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