Commit 04cd549c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Don't delete state-input mappings of aggregations

parent b0f7abd0
......@@ -463,6 +463,7 @@ package {process_name} is'''.format(process_name=process_name,
return
taste_template.append(u'when {state} =>'.format(state=state))
input_def = mapping[signame].get(state)
#print signame, input_def
if state in aggregates.viewkeys():
# State aggregation:
# - find which substate manages this input
......
......@@ -226,6 +226,7 @@ def flatten(process, sep=u'_'):
# Go recursively in inner composite states
inner.statename = prefix + inner.statename
update_composite_state(inner, process)
# Remove: recursion is already handled within propagate_inputs
#propagate_inputs(inner, process)
#del process.mapping[inner.statename]
for each in state.terminators:
......@@ -272,7 +273,9 @@ def flatten(process, sep=u'_'):
for each in nested_state.composite_states:
# do the same recursively
propagate_inputs(each, nested_state)
del nested_state.mapping[each.statename]
#del nested_state.mapping[each.statename]
if not isinstance(nested_state, ogAST.StateAggregation):
del context.mapping[nested_state.statename]
def set_terminator_states(context, prefix=''):
''' Associate state to terminators, needed to process properly
......@@ -297,7 +300,7 @@ def flatten(process, sep=u'_'):
for each in process.composite_states:
update_composite_state(each, process)
propagate_inputs(each, process)
del process.mapping[each.statename]
#del process.mapping[each.statename]
# Update terminators at process level
for each in process.terminators:
......
......@@ -29,6 +29,15 @@ exit_aggreg;
SUBSTRUCTURE
STATE a;
SUBSTRUCTURE
/* CIF PROCEDURE (159, 386), (77, 35) */
PROCEDURE entry;
/* CIF START (119, 58), (70, 35) */
START;
/* CIF PROCEDURECALL (28, 108), (250, 35) */
CALL writeln('[a] entry (before startup)');
/* CIF RETURN (136, 158), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (0, 57), (70, 35) */
START;
/* CIF PROCEDURECALL (-64, 107), (198, 35) */
......@@ -103,35 +112,36 @@ dcl x myInteger;
START;
/* CIF NEXTSTATE (0, 299), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (577, 469), (67, 35) */
/* CIF STATE (390, 307), (67, 35) */
STATE wait;
/* CIF INPUT (555, 524), (110, 35) */
/* CIF INPUT (368, 362), (110, 35) */
INPUT exit_aggreg;
/* CIF PROCEDURECALL (490, 574), (241, 34) */
CALL writeln('Stop state aggregation');
/* CIF NEXTSTATE (566, 623), (87, 35) */
/* CIF PROCEDURECALL (325, 412), (195, 34) */
CALL writeln('got exit_aggreg');
/* CIF NEXTSTATE (379, 461), (87, 35) */
NEXTSTATE the_end;
ENDSTATE;
/* CIF STATE (649, 303), (87, 35) */
STATE the_end;
/* CIF INPUT (640, 358), (107, 35) */
INPUT reset_all(x);
/* CIF PROCEDURECALL (544, 408), (300, 35) */
CALL writeln('Entering again aggregation');
/* CIF NEXTSTATE (659, 458), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (0, 299), (70, 35) */
STATE wait;
/* CIF INPUT (-19, 354), (107, 35) */
INPUT reset_all(x)
/* CIF COMMENT (108, 354), (372, 40) */
COMMENT 'Transition is handled by a state in the state aggregation';
/* CIF COMMENT (108, 338), (227, 50) */
COMMENT 'Transition is handled by
a state in the state aggregation';
/* CIF PROCEDURECALL (-115, 404), (300, 35) */
CALL writeln('[ERROR] Should never be called');
/* CIF NEXTSTATE (0, 454), (70, 35) */
NEXTSTATE -;
ENDSTATE;
/* CIF STATE (847, 464), (87, 35) */
STATE the_end;
/* CIF INPUT (837, 519), (107, 35) */
INPUT reset_all(x);
/* CIF PROCEDURECALL (741, 569), (300, 35) */
CALL writeln('Entering again aggregation');
/* CIF NEXTSTATE (856, 619), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
ENDPROCESS og;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
Markdown is supported
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