Commit a1225044 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete test case aggregation1

parent f3d6a802
...@@ -557,10 +557,12 @@ class SDL_Scene(QtGui.QGraphicsScene, object): ...@@ -557,10 +557,12 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
# Render nested scenes, recursively: # Render nested scenes, recursively:
for each in (item for item in dest_scene.visible_symb for each in (item for item in dest_scene.visible_symb
if item.nested_scene): if item.nested_scene):
LOG.debug(u'Recursive scene: ' + unicode(each))
if isinstance(each.nested_scene, ogAST.CompositeState) \ if isinstance(each.nested_scene, ogAST.CompositeState) \
and (not each.nested_scene.statename and (not each.nested_scene.statename
or each.nested_scene in already_created): or each.nested_scene in already_created):
# Ignore nested state scenes that already exist # Ignore nested state scenes that already exist
LOG.debug('Subscene "{}" ignored'.format(unicode(each)))
continue continue
subscene = \ subscene = \
self.create_subscene(each.__class__.__name__.lower(), self.create_subscene(each.__class__.__name__.lower(),
......
/* CIF PROCESS (150, 150), (150, 75) */ /* CIF PROCESS (150, 150), (150, 75) */
PROCESS challenge; PROCESS challenge;
STATE AGGREGATION Safe;
SUBSTRUCTURE
STATE A;
SUBSTRUCTURE
START;
NEXTSTATE HA;
STATE HA;
input run;
nextstate -;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE B;
SUBSTRUCTURE
START;
NEXTSTATE BEH;
STATE BEH;
input any_one;
nextstate beh;
ENDSTATE;
ENDSUBSTRUCTURE;
ENDSUBSTRUCTURE;
STATE on; STATE on;
SUBSTRUCTURE SUBSTRUCTURE
in (via_toto); in (via_toto);
...@@ -48,47 +27,60 @@ PROCESS challenge; ...@@ -48,47 +27,60 @@ PROCESS challenge;
ENDSUBSTRUCTURE; ENDSUBSTRUCTURE;
STATE AGGREGATION AggregNextToHello; STATE AGGREGATION AggregNextToHello;
SUBSTRUCTURE SUBSTRUCTURE
STATE C; STATE C;
SUBSTRUCTURE SUBSTRUCTURE
START; /* CIF START (0, 0), (70, 35) */
NEXTSTATE CEH; START;
STATE CEH; /* CIF NEXTSTATE (0, 50), (70, 35) */
input any_two; NEXTSTATE CEH;
nextstate ceh; /* CIF STATE (116, 0), (70, 35) */
STATE CEH;
/* CIF INPUT (98, 55), (88, 35) */
INPUT any_two;
/* CIF NEXTSTATE (107, 105), (70, 35) */
NEXTSTATE ceh;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE D;
SUBSTRUCTURE
/* CIF START (80, 0), (70, 35) */
START;
/* CIF NEXTSTATE (80, 50), (70, 35) */
NEXTSTATE DEH;
/* CIF STATE (80, 0), (70, 35) */
STATE DEH;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (77, 25), (70, 35) */
STATE D;
ENDSTATE; ENDSTATE;
ENDSUBSTRUCTURE; /* CIF STATE (157, 0), (70, 35) */
STATE D; STATE C;
SUBSTRUCTURE
START;
NEXTSTATE DEH;
STATE DEH;
ENDSTATE; ENDSTATE;
ENDSUBSTRUCTURE;
ENDSUBSTRUCTURE; ENDSUBSTRUCTURE;
/* CIF TEXT (528, 251), (334, 95) */
/* CIF TEXT (242, 251), (334, 95) */
dcl myresult T_UInt8 := 4; dcl myresult T_UInt8 := 4;
-- Use a variable with the same name as a variable -- Use a variable with the same name as a variable
-- in the outer scope, to check that code generators -- in the outer scope, to check that code generators
-- use the proper one -- use the proper one
dcl result T_UInt32 := 9; dcl result T_UInt32 := 9;
/* CIF ENDTEXT */ /* CIF ENDTEXT */
/* CIF PROCEDURE (554, 54), (73, 35) */ /* CIF PROCEDURE (775, 143), (70, 33) */
PROCEDURE entry PROCEDURE exit
/* CIF COMMENT (643, 31), (190, 83) */ /* CIF COMMENT (865, 118), (157, 93) */
COMMENT 'Special Entry COMMENT 'Special exit
procedure - called procedure - called
automatically upon automatically when
entrance to the nested leaving the nested
state'; state';
/* CIF START (191, 78), (70, 35) */ /* CIF START (163, 119), (70, 35) */
START; START;
/* CIF PROCEDURECALL (100, 128), (251, 35) */ /* CIF PROCEDURECALL (68, 169), (259, 35) */
CALL writeln('ENTERING NESTED STATE'); CALL writeln('LEAVING the nested state');
/* CIF RETURN (208, 178), (35, 35) */ /* CIF RETURN (180, 219), (35, 35) */
RETURN ; RETURN ;
ENDPROCEDURE; ENDPROCEDURE;
/* CIF PROCEDURE (239, 522), (102, 35) */ /* CIF PROCEDURE (456, 522), (102, 35) */
PROCEDURE inner_proc; PROCEDURE inner_proc;
/* CIF TEXT (31, 41), (364, 93) */ /* CIF TEXT (31, 41), (364, 93) */
fpar in toto T_UInt8; fpar in toto T_UInt8;
...@@ -109,114 +101,153 @@ dcl result t_Boolean := true; ...@@ -109,114 +101,153 @@ dcl result t_Boolean := true;
/* CIF RETURN (496, 347), (35, 35) */ /* CIF RETURN (496, 347), (35, 35) */
RETURN ; RETURN ;
ENDPROCEDURE; ENDPROCEDURE;
/* CIF PROCEDURE (558, 143), (70, 33) */ /* CIF PROCEDURE (771, 54), (73, 35) */
PROCEDURE exit PROCEDURE entry
/* CIF COMMENT (648, 118), (157, 93) */ /* CIF COMMENT (860, 31), (190, 83) */
COMMENT 'Special exit COMMENT 'Special Entry
procedure - called procedure - called
automatically when automatically upon
leaving the nested entrance to the nested
state'; state';
/* CIF START (163, 119), (70, 35) */ /* CIF START (191, 78), (70, 35) */
START; START;
/* CIF PROCEDURECALL (68, 169), (259, 35) */ /* CIF PROCEDURECALL (100, 128), (251, 35) */
CALL writeln('LEAVING the nested state'); CALL writeln('ENTERING NESTED STATE');
/* CIF RETURN (180, 219), (35, 35) */ /* CIF RETURN (208, 178), (35, 35) */
RETURN ; RETURN ;
ENDPROCEDURE; ENDPROCEDURE;
/* CIF START (1188, 7), (89, 35) */ /* CIF START (1405, 7), (89, 35) */
START via_toto ; START via_toto ;
/* CIF PROCEDURECALL (1179, 57), (106, 35) */ /* CIF PROCEDURECALL (1397, 57), (106, 35) */
CALL writeln('3'); CALL writeln('3');
/* CIF RETURN (1215, 107), (35, 35) */ /* CIF RETURN (1432, 107), (35, 35) */
RETURN ret0; RETURN ret0;
/* CIF START (938, 8), (70, 35) */ /* CIF START (1155, 8), (70, 35) */
START; START;
/* CIF PROCEDURECALL (920, 58), (106, 35) */ /* CIF PROCEDURECALL (1137, 58), (106, 35) */
CALL writeln('7'); CALL writeln('7');
/* CIF LABEL (917, 108), (111, 35) */ /* CIF LABEL (1135, 108), (111, 35) */
inside_label: inside_label:
/* CIF PROCEDURECALL (904, 158), (137, 35) */ /* CIF PROCEDURECALL (1122, 158), (137, 35) */
CALL pow(3,3, result); CALL pow(3,3, result);
/* CIF DECISION (936, 208), (74, 50) */ /* CIF DECISION (1153, 208), (74, 50) */
DECISION result; DECISION result;
/* CIF ANSWER (861, 278), (92, 23) */ /* CIF ANSWER (1078, 278), (92, 23) */
(myresult): (myresult):
/* CIF ANSWER (985, 278), (70, 23) */ /* CIF ANSWER (1202, 278), (70, 23) */
ELSE: ELSE:
/* CIF TASK (962, 316), (115, 35) */ /* CIF TASK (1180, 316), (115, 35) */
TASK myresult := 5; TASK myresult := 5;
ENDDECISION; ENDDECISION;
/* CIF LABEL (929, 366), (88, 35) */ /* CIF LABEL (1146, 366), (88, 35) */
nslabel: nslabel:
/* CIF NEXTSTATE (938, 416), (70, 35) */ /* CIF NEXTSTATE (1110, 416), (161, 35) */
NEXTSTATE AggregNextToHello; NEXTSTATE AggregNextToHello;
/* CIF LABEL (512, 472), (141, 35) */ /* CIF LABEL (349, 324), (90, 35) */
CONNECTION to_label:
/* CIF JOIN (377, 374), (35, 35) */
JOIN another_floating;
/* CIF End Label */
ENDCONNECTION;
/* CIF LABEL (729, 472), (141, 35) */
CONNECTION another_floating: CONNECTION another_floating:
/* CIF PROCEDURECALL (526, 522), (113, 35) */ /* CIF PROCEDURECALL (743, 522), (113, 35) */
CALL writeln('9'); CALL writeln('9');
/* CIF TASK (525, 572), (115, 35) */ /* CIF TASK (742, 572), (115, 35) */
TASK myresult := 1; TASK myresult := 1;
/* CIF PROCEDURECALL (500, 622), (164, 35) */ /* CIF PROCEDURECALL (718, 622), (164, 35) */
CALL inner_proc(myresult); CALL inner_proc(myresult);
/* CIF RETURN (565, 672), (35, 35) */ /* CIF RETURN (782, 672), (35, 35) */
RETURN ; RETURN ;
/* CIF End Label */ /* CIF End Label */
ENDCONNECTION; ENDCONNECTION;
/* CIF LABEL (132, 324), (90, 35) */ /* CIF STATE (0, 0), (161, 35) */
CONNECTION to_label: STATE AggregNextToHello;
/* CIF JOIN (159, 374), (35, 35) */ ENDSTATE;
JOIN another_floating; /* CIF STATE (389, 0), (70, 35) */
/* CIF End Label */
ENDCONNECTION;
/* CIF STATE (0, 0), (70, 35) */
STATE hello; STATE hello;
/* CIF INPUT (6, 55), (70, 35) */ /* CIF INPUT (395, 55), (70, 35) */
INPUT run; INPUT run;
/* CIF PROCEDURECALL (-46, 111), (175, 35) */ /* CIF PROCEDURECALL (343, 111), (175, 35) */
CALL writeln('27 == ', result); CALL writeln('27 == ', result);
/* CIF TASK (-21, 161), (125, 53) */ /* CIF TASK (368, 161), (125, 53) */
TASK myresult := 88, TASK myresult := 88,
result := 33; result := 33;
/* CIF JOIN (24, 229), (35, 35) */ /* CIF JOIN (413, 229), (35, 35) */
JOIN to_label; JOIN to_label;
ENDSTATE; ENDSTATE;
state AggregNextToHello;
endstate;
ENDSUBSTRUCTURE; ENDSUBSTRUCTURE;
/* CIF TEXT (51, 0), (298, 56) */ STATE AGGREGATION safe;
SUBSTRUCTURE
STATE A;
SUBSTRUCTURE
/* CIF START (154, 0), (70, 35) */
START;
/* CIF NEXTSTATE (154, 50), (70, 35) */
NEXTSTATE HA;
/* CIF STATE (0, 0), (70, 35) */
STATE HA;
/* CIF INPUT (6, 55), (70, 35) */
INPUT run;
/* CIF NEXTSTATE (6, 105), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE B;
SUBSTRUCTURE
/* CIF START (139, 0), (70, 35) */
START;
/* CIF NEXTSTATE (139, 50), (70, 35) */
NEXTSTATE BEH;
/* CIF STATE (0, 0), (70, 35) */
STATE BEH;
/* CIF INPUT (-18, 55), (88, 35) */
INPUT any_one;
/* CIF NEXTSTATE (-9, 105), (70, 35) */
NEXTSTATE beh;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (171, 147), (70, 33) */
STATE B;
ENDSTATE;
/* CIF STATE (160, 0), (70, 35) */
STATE A;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF TEXT (109, 0), (298, 56) */
-- This system tests nested states -- This system tests nested states
dcl result T_uint32 :=0; dcl result T_uint32 :=0;
/* CIF ENDTEXT */ /* CIF ENDTEXT */
/* CIF START (0, 113), (68, 37) */ /* CIF START (29, 113), (68, 37) */
START; START;
/* CIF PROCEDURECALL (-19, 165), (106, 35) */ /* CIF PROCEDURECALL (10, 165), (106, 35) */
CALL writeln('1'); CALL writeln('1');
/* CIF NEXTSTATE (-1, 215), (70, 35) */ /* CIF NEXTSTATE (28, 215), (70, 35) */
NEXTSTATE OFF; NEXTSTATE OFF;
/* CIF STATE (234, 140), (65, 35) */ /* CIF STATE (0, 0), (70, 35) */
STATE safe;
ENDSTATE;
/* CIF STATE (263, 140), (65, 35) */
STATE on; STATE on;
/* CIF CONNECT (267, 195), (0, 35) */ /* CIF CONNECT (296, 195), (0, 35) */
CONNECT ret0; CONNECT ret0;
/* CIF NEXTSTATE (234, 245), (67, 35) */ /* CIF NEXTSTATE (262, 245), (67, 35) */
NEXTSTATE Safe; NEXTSTATE Safe;
/* CIF CONNECT (179, 195), (0, 35) */ /* CIF CONNECT (208, 195), (0, 35) */
CONNECT ; CONNECT ;
/* CIF NEXTSTATE (144, 245), (70, 35) */ /* CIF NEXTSTATE (173, 245), (70, 35) */
NEXTSTATE off; NEXTSTATE off;
ENDSTATE; ENDSTATE;
/* CIF STATE (-1, 215), (70, 35) */ /* CIF STATE (28, 215), (70, 35) */
STATE OFF; STATE OFF;
/* CIF INPUT (-1, 270), (70, 35) */ /* CIF INPUT (28, 270), (70, 35) */
INPUT run; INPUT run;
/* CIF PROCEDURECALL (-19, 320), (106, 35) */ /* CIF PROCEDURECALL (10, 320), (106, 35) */
CALL writeln('2'); CALL writeln('2');
/* CIF NEXTSTATE (-32, 371), (132, 35) */ /* CIF NEXTSTATE (36, 371), (53, 35) */
NEXTSTATE on NEXTSTATE on
/* CIF COMMENT (119, 371), (219, 35) */ /* CIF COMMENT (108, 371), (219, 35) */
COMMENT 'Enter substate via entry point'; COMMENT 'Enter substate via entry point';
ENDSTATE; ENDSTATE;
state safe; ENDPROCESS challenge;
endstate; \ No newline at end of file
ENDPROCESS challenge;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment