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