Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
e342fd8f
Commit
e342fd8f
authored
Nov 11, 2014
by
Maxime Perrotin
Browse files
Support empty procedures
parent
c700dd2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
AdaGenerator.py
View file @
e342fd8f
...
...
@@ -1673,8 +1673,10 @@ def _inner_procedure(proc):
# Look for labels in the diagram and transform them in floating labels
Helper
.
inner_labels_to_floating
(
proc
)
tr_code
,
tr_decl
=
generate
(
proc
.
content
.
start
.
transition
)
if
proc
.
content
.
start
:
tr_code
,
tr_decl
=
generate
(
proc
.
content
.
start
.
transition
)
else
:
tr_code
,
tr_decl
=
[
'null; -- Empty procedure'
],
[]
# Generate code for the floating labels
code_labels
=
[]
for
label
in
proc
.
content
.
floating_labels
:
...
...
Helper.py
View file @
e342fd8f
...
...
@@ -67,8 +67,9 @@ def inner_labels_to_floating(process):
for
proc_tr
in
process
.
transitions
:
for
new_floating
in
find_labels
(
proc_tr
):
process
.
content
.
floating_labels
.
append
(
new_floating
)
for
new_floating
in
find_labels
(
process
.
content
.
start
.
transition
):
process
.
content
.
floating_labels
.
append
(
new_floating
)
if
process
.
content
.
start
:
for
new_floating
in
find_labels
(
process
.
content
.
start
.
transition
):
process
.
content
.
floating_labels
.
append
(
new_floating
)
for
each
in
process
.
content
.
named_start
:
for
new_floating
in
find_labels
(
each
.
transition
):
process
.
content
.
floating_labels
.
append
(
new_floating
)
...
...
tests/regression/test-debug/orchestrator.pr
View file @
e342fd8f
...
...
@@ -21,88 +21,95 @@ dcl check tasTE_Peek_id;
dcl choice choice;
/* CIF ENDTEXT */
/* CIF START (428, 223), (100, 45) */
/* CIF PROCEDURE (727, 175), (106, 35) */
PROCEDURE emptyproc;
ENDPROCEDURE;
/* CIF START (438, 223), (80, 36) */
START;
/* CIF DECISION (428, 283), (99, 50) */
DECISION 'informal';
/* CIF ANSWER (398, 353), (70, 23) */
/* CIF DECISION (428, 274), (99, 50) */
DECISION 'informal'
/* CIF COMMENT (547, 281), (179, 53) */
COMMENT 'Informal decision -
check that it is ignored
by the code generator';
/* CIF ANSWER (398, 344), (70, 33) */
('a'):
/* CIF ANSWER (488, 3
53
), (70, 33) */
/* CIF ANSWER (488, 3
44
), (70, 33) */
('2'):
ENDDECISION;
/* CIF TASK (366,
401
), (223, 38) */
/* CIF TASK (366,
392
), (223, 38) */
TASK seqboolean := {true, false},
seqboolean := not {true, false};
/* CIF TASK (396, 4
5
4), (164, 53) */
/* CIF TASK (396, 44
5
), (164, 53) */
TASK for x in seqen:
call writeln(num(x));
endfor;
/* CIF TASK (396, 5
22
), (164, 53) */
/* CIF TASK (396, 5
13
), (164, 53) */
TASK for x in seqen2:
call writeln(num(x));
endfor;
/* CIF TASK (397, 5
90
), (162, 53) */
/* CIF TASK (397, 5
81
), (162, 53) */
TASK for x in seqboolean:
call writeln(x);
endfor
/* CIF COMMENT (579, 59
9
), (168, 38) */
/* CIF COMMENT (579, 59
0
), (168, 38) */
COMMENT 'FOR with a basic type';
/* CIF TASK (367, 6
58
), (222, 35) */
/* CIF TASK (367, 6
49
), (222, 35) */
TASK seqboolean := not seqboolean
/* CIF COMMENT (609, 6
58
), (279, 35) */
/* CIF COMMENT (609, 6
49
), (279, 35) */
COMMENT 'check NOT on a SEQUENCE of BOOLEAN';
/* CIF TASK (397,
708
), (162, 53) */
/* CIF TASK (397,
699
), (162, 53) */
TASK for x in seqboolean:
call writeln(x);
endfor;
/* CIF TASK (415, 7
7
6), (126, 38) */
/* CIF TASK (415, 76
7
), (126, 38) */
TASK fixed := 'hello';
/* CIF TASK (403, 82
9
), (149, 35) */
/* CIF TASK (403, 82
0
), (149, 35) */
TASK variable := 'HELLO';
/* CIF PROCEDURECALL (390, 87
9
), (176, 35) */
/* CIF PROCEDURECALL (390, 87
0
), (176, 35) */
CALL writeln(variable // '!!!');
/* CIF PROCEDURECALL (342, 92
9
), (272, 35) */
/* CIF PROCEDURECALL (342, 92
0
), (272, 35) */
CALL writeln(variable // variable // variable);
/* CIF TASK (432, 97
9
), (91, 35) */
/* CIF TASK (432, 97
0
), (91, 35) */
TASK seq := {1};
/* CIF TASK (401, 102
9
), (153, 35) */
/* CIF TASK (401, 102
0
), (153, 35) */
TASK seq := {1} // {2} // {3};
/* CIF TASK (392, 107
9
), (172, 35) */
/* CIF TASK (392, 107
0
), (172, 35) */
TASK seq := seq // {2} // {1};
/* CIF DECISION (443, 112
9
), (70, 50) */
/* CIF DECISION (443, 112
0
), (70, 50) */
DECISION any;
/* CIF ANSWER (398, 119
9
), (70, 23) */
/* CIF ANSWER (398, 119
0
), (70, 23) */
('a'):
/* CIF ANSWER (488, 119
9
), (70, 23) */
/* CIF ANSWER (488, 119
0
), (70, 23) */
('b'):
ENDDECISION;
/* CIF DECISION (433, 12
37
), (89, 50) */
/* CIF DECISION (433, 12
28
), (89, 50) */
DECISION myenum
/* CIF COMMENT (542, 12
44
), (183, 35) */
/* CIF COMMENT (542, 12
35
), (183, 35) */
COMMENT 'Check case insensitivity';
/* CIF ANSWER (250, 1
307
), (70, 23) */
/* CIF ANSWER (250, 1
298
), (70, 23) */
(a):
/* CIF ANSWER (330, 1
307
), (70, 23) */
/* CIF ANSWER (330, 1
298
), (70, 23) */
(B):
/* CIF ANSWER (410, 1
307
), (70, 23) */
/* CIF ANSWER (410, 1
298
), (70, 23) */
(c):
/* CIF ANSWER (488, 1
307
), (70, 23) */
/* CIF ANSWER (488, 1
298
), (70, 23) */
(d):
/* CIF ANSWER (576, 1
307
), (70, 23) */
/* CIF ANSWER (576, 1
298
), (70, 23) */
(Ee):
ENDDECISION;
/* CIF DECISION (409, 13
45
), (138, 50) */
/* CIF DECISION (409, 13
36
), (138, 50) */
DECISION present(choice)
/* CIF COMMENT (566, 13
52
), (183, 35) */
/* CIF COMMENT (566, 13
43
), (183, 35) */
COMMENT 'Check case insensitivity';
/* CIF ANSWER (361, 14
15
), (70, 23) */
/* CIF ANSWER (361, 14
06
), (70, 23) */
(cde2):
/* CIF ANSWER (532, 14
15
), (70, 23) */
/* CIF ANSWER (532, 14
06
), (70, 23) */
ELSE:
ENDDECISION;
/* CIF NEXTSTATE (419, 14
53
), (116, 33) */
/* CIF NEXTSTATE (419, 14
44
), (116, 33) */
NEXTSTATE Wait_for_GUI;
/* CIF STATE (42
3
, 163), (11
8
,
50
) */
/* CIF STATE (42
4
, 163), (11
6
,
33
) */
STATE Wait_for_GUI;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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