Commit 7c1d739d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Run simple test case with aggregation

parent 19c828d2
...@@ -255,8 +255,9 @@ LD_LIBRARY_PATH=. taste-gui -l ...@@ -255,8 +255,9 @@ LD_LIBRARY_PATH=. taste-gui -l
aggreg_start_proc.extend(u'runTransition({sub}{sep}START);' aggreg_start_proc.extend(u'runTransition({sub}{sep}START);'
.format(sub=subname, sep=UNICODE_SEP) .format(sub=subname, sep=UNICODE_SEP)
for subname in substates) for subname in substates)
aggreg_start_proc.append(u'{ctxt}.state := {name};' #Following done in the transition, not needed here
.format(ctxt=LPREFIX, name=name)) #aggreg_start_proc.append(u'{ctxt}.state := {name};'
# .format(ctxt=LPREFIX, name=name))
aggreg_start_proc.extend([u'end {}{}START;' aggreg_start_proc.extend([u'end {}{}START;'
.format(name, UNICODE_SEP), .format(name, UNICODE_SEP),
'\n']) '\n'])
...@@ -1923,6 +1924,7 @@ def _transition(tr, **kwargs): ...@@ -1923,6 +1924,7 @@ def _transition(tr, **kwargs):
code.append(u'{ctxt}.state := {nextState};' code.append(u'{ctxt}.state := {nextState};'
.format(ctxt=LPREFIX, .format(ctxt=LPREFIX,
nextState=tr.terminator.inputString)) nextState=tr.terminator.inputString))
code.append(u'trId := -1;') # CHECKME
elif tr.terminator.inputString.strip() != '-': elif tr.terminator.inputString.strip() != '-':
code.append(u'trId := ' + code.append(u'trId := ' +
unicode(tr.terminator.next_id) + u';') unicode(tr.terminator.next_id) + u';')
......
...@@ -40,7 +40,6 @@ __all__ = ['flatten', 'rename_everything', 'inner_labels_to_floating', ...@@ -40,7 +40,6 @@ __all__ = ['flatten', 'rename_everything', 'inner_labels_to_floating',
def state_aggregations(process): def state_aggregations(process):
''' Return the list of state aggregations and substates ''' ''' Return the list of state aggregations and substates '''
#aggregates, substates = [], []
# { aggregate_name : [list of parallel states] } # { aggregate_name : [list of parallel states] }
aggregates = defaultdict(list) aggregates = defaultdict(list)
def do_composite(comp, aggregate=''): def do_composite(comp, aggregate=''):
...@@ -54,12 +53,8 @@ def state_aggregations(process): ...@@ -54,12 +53,8 @@ def state_aggregations(process):
for term in comp.terminators: for term in comp.terminators:
if term.inputString.lower() == each.statename.lower(): if term.inputString.lower() == each.statename.lower():
term.next_is_aggregation = True term.next_is_aggregation = True
if isinstance(comp, ogAST.StateAggregation): if aggregate and not isinstance(comp, ogAST.StateAggregation):
pass
#aggregates.append(comp.statename)
elif aggregate: # Elif: no state for an inner state aggregation
# Composite state inside a state aggregation # Composite state inside a state aggregation
#substates.append(comp.statename)
aggregates[aggregate].append(comp.statename) aggregates[aggregate].append(comp.statename)
# Here, all the terminators inside the composite states must # Here, all the terminators inside the composite states must
# be flagged with the name of the substate so that the NEXTSTATE # be flagged with the name of the substate so that the NEXTSTATE
...@@ -72,7 +67,7 @@ def state_aggregations(process): ...@@ -72,7 +67,7 @@ def state_aggregations(process):
for each in process.terminators: for each in process.terminators:
if each.inputString.lower() in aggregates: if each.inputString.lower() in aggregates:
each.next_is_aggregation = True each.next_is_aggregation = True
return aggregates #, substates return aggregates
def map_input_state(process): def map_input_state(process):
......
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