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
f2030c3c
Commit
f2030c3c
authored
Jul 11, 2020
by
Maxime Perrotin
Browse files
Parse properly instance/via clauses
parent
18db5dda
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
f2030c3c
...
...
@@ -123,8 +123,8 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
**3.
1.3
(07/2020)**
-
Fix issue finding ASN.1 files when model loaded from another folder
**3.
2.0
(07/2020)**
-
Add basic support for state type/instance
**3.1.2 (07/2020)**
-
Reinforce syntax error checking and reporting
...
...
opengeode/icons.py
View file @
f2030c3c
This diff is collapsed.
Click to expand it.
opengeode/ogParser.py
View file @
f2030c3c
...
...
@@ -3857,6 +3857,7 @@ def state(root, parent, context):
state_def
.
charPositionInLine
=
child
.
getCharPositionInLine
()
state_def
.
statelist
=
[
state_def
.
inputString
]
inst_stop
=
child
.
getTokenStopIndex
()
via_stop
=
inst_stop
# in case there is also a via clause
elif
child
.
type
==
lexer
.
TYPE_INSTANCE
:
# Extract the complete string "state: instance"
start
=
inst_stop
...
...
@@ -3926,8 +3927,8 @@ def state(root, parent, context):
.
format
(
each
,
statename
.
lower
()))
# then update the mapping state-input
context
.
mapping
[
statename
.
lower
()].
append
(
inp
)
except
KeyError
:
stwarn
.
append
(
'State definition missing'
)
except
KeyError
as
err
:
stwarn
.
append
(
f
'State definition missing
-
{
str
(
err
)
}
'
)
state_def
.
inputs
.
append
(
inp
)
if
inp
.
inputString
.
strip
()
==
'*'
:
if
asterisk_input
:
...
...
opengeode/opengeode.py
View file @
f2030c3c
...
...
@@ -140,7 +140,7 @@ except ImportError:
__all__
=
[
'opengeode'
,
'SDL_Scene'
,
'SDL_View'
,
'parse'
]
__version__
=
'3.
1.3
'
__version__
=
'3.
2.0
'
if
hasattr
(
sys
,
'frozen'
):
# Detect if we are running on Windows (py2exe-generated)
...
...
opengeode/sdl92Lexer.py
View file @
f2030c3c
This diff is collapsed.
Click to expand it.
opengeode/sdl92Parser.py
View file @
f2030c3c
This diff is collapsed.
Click to expand it.
sdl92.g
View file @
f2030c3c
...
...
@@ -478,28 +478,30 @@ floating_label
-> ^(FLOATING_LABEL cif? hyperlink? connector_name transition?)
;
// state is either a full state definition, or a
declaration of an
instance
// state is either a full state definition, or a
state
instance
state
: state_definition
| state_instance
;
// the "via" part is needed to allow the graphical merge with a nextstate
state_definition
: cif?
hyperlink?
STATE statelist (e=end | SEMI)
// "via" part may be in NEXTSTATE
STATE statelist
via?
(e=end | SEMI)
(state_part)*
ENDSTATE statename? f=end
-> ^(STATE cif? hyperlink? $e? statelist state_part*)
-> ^(STATE cif? hyperlink? $e? statelist
via?
state_part*)
;
state_instance
: cif?
hyperlink?
STATE statename ':' type_inst e=end
STATE statename ':' type_inst via? (e=end | SEMI)
(state_part)*
ENDSTATE statename? f=end
-> ^(STATE cif? hyperlink? $e? statename type_inst)
-> ^(STATE cif? hyperlink? $e? statename
via?
type_inst
state_part*
)
;
...
...
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