Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
3745cd22
Commit
3745cd22
authored
Jul 13, 2014
by
Maxime Perrotin
Browse files
Semantic check when entering a composite state
parent
e3c5d1b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ogParser.py
View file @
3745cd22
...
...
@@ -2814,7 +2814,8 @@ def decision(root, parent, context):
def
nextstate
(
root
,
context
):
''' Parse a NEXTSTATE [VIA State_Entry_Point] '''
''' Parse a NEXTSTATE [VIA State_Entry_Point] - detect various kinds of
errors when trying to enter a nested state '''
next_state_id
,
via
,
entrypoint
=
''
,
None
,
None
errors
=
[]
for
child
in
root
.
getChildren
():
...
...
@@ -2849,6 +2850,16 @@ def nextstate(root, context):
errors
.
append
(
'"History" NEXTSTATE cannot have a "via" clause'
)
else
:
errors
.
append
(
'NEXTSTATE undefined construct'
)
if
not
via
:
# check that if the nextstate is nested, it has a START symbol
try
:
composite
,
=
(
comp
for
comp
in
context
.
composite_states
if
comp
.
statename
.
lower
()
==
next_state_id
.
lower
())
if
not
composite
.
content
.
start
:
errors
.
append
(
'Composite state "{}" has no unnamed '
'START symbol'
.
format
(
composite
.
statename
))
except
ValueError
:
pass
return
next_state_id
,
via
,
entrypoint
,
errors
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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