Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenGEODE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
OpenGEODE
Commits
862b5c4f
Commit
862b5c4f
authored
Oct 04, 2020
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes for stop conditions
parent
c1726413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
opengeode/AdaGenerator.py
opengeode/AdaGenerator.py
+9
-9
No files found.
opengeode/AdaGenerator.py
View file @
862b5c4f
...
...
@@ -547,7 +547,9 @@ package body {process_name} is'''
imp_datamodel
=
(
f"with
{
process_name
}
_Datamodel; "
f"use
{
process_name
}
_Datamodel;"
)
\
if
not
import_context
and
not
instance
else
""
if
not
import_context
and
not
instance
else
(
f"with
{
import_context
}
_Datamodel; "
f"use
{
import_context
}
_Datamodel;"
)
imp_ri
=
f"with
{
process_name
}
_RI;"
if
not
simu
and
not
generic
else
""
...
...
@@ -601,7 +603,7 @@ package body {process_name}_RI is''']
ads_template
.
extend
(
rand_decl
)
if
not
instance
:
ads_template
.
extend
(
context_decl
)
if
not
generic
and
not
instance
:
if
not
generic
and
not
instance
and
not
import_context
:
# Add function allowing to trace current state as a string
ads_template
.
append
(
f"function Get_State return chars_ptr "
...
...
@@ -1673,7 +1675,7 @@ def _primary_variable(prim, **kwargs):
else
:
sep
=
LPREFIX
+
'.'
ada_string
=
u'{sep}{name}'
.
format
(
sep
=
sep
,
name
=
prim
.
value
[
0
])
ada_string
=
f'
{
sep
}{
prim
.
value
[
0
]
}
'
return
[],
str
(
ada_string
),
[]
...
...
@@ -2009,9 +2011,7 @@ def _prim_selector(prim, **kwargs):
# for asn1scc v3, sort = type_name(receiver.exprType)
if
receiver_bty
.
kind
==
'ChoiceType'
:
ada_string
=
(
u'{ada_string}.{field_name}'
.
format
(
field_name
=
field_name
,
ada_string
=
ada_string
))
ada_string
=
f'
{
ada_string
}
.
{
field_name
}
'
else
:
# SEQUENCE, check for field optionality first
child
=
child_spelling
(
field_name
,
receiver_bty
)
...
...
@@ -2019,7 +2019,7 @@ def _prim_selector(prim, **kwargs):
and
not
kwargs
.
get
(
"readonly"
,
0
):
# Must set Exist only when assigning value, not each time it is
# accessed: this is what "readonly" ensures.
stmts
.
append
(
u'{}.Exist.{} := 1;'
.
format
(
ada_string
,
field_name
)
)
stmts
.
append
(
f'
{
ada_string
}
.Exist.
{
field_name
}
:= 1;'
)
ada_string
+=
'.'
+
field_name
return
stmts
,
str
(
ada_string
),
local_decl
...
...
@@ -2028,7 +2028,7 @@ def _prim_selector(prim, **kwargs):
@
expression
.
register
(
ogAST
.
PrimStateReference
)
def
_primary_state_reference
(
prim
,
**
kwargs
):
''' Reference to the current state '''
return
[],
u'{}.state'
.
format
(
LPREFIX
)
,
[]
return
[],
f'
{
LPREFIX
}
.state'
,
[]
@
expression
.
register
(
ogAST
.
ExprPlus
)
@
expression
.
register
(
ogAST
.
ExprMul
)
...
...
@@ -3257,7 +3257,7 @@ def type_name(a_type, use_prefix=True):
elif
a_type
.
kind
==
'ChoiceEnumeratedType'
:
return
'Asn1InT'
elif
a_type
.
kind
==
'StateEnumeratedType'
:
return
''
return
'
asn1Scc
'
elif
a_type
.
kind
==
'EnumeratedType'
:
return
'asn1Scc'
if
use_prefix
else
''
else
:
...
...
Write
Preview
Markdown
is supported
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