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
da1fff7a
Commit
da1fff7a
authored
Nov 11, 2014
by
Maxime Perrotin
Browse files
Call exit and entry procedures with prefix
parent
f5899162
Changes
2
Hide whitespace changes
Inline
Side-by-side
AdaGenerator.py
View file @
da1fff7a
...
...
@@ -255,7 +255,8 @@ package {process_name} is'''.format(process_name=process_name,
for
each
in
reversed
(
exitlist
):
if
trans
and
all
(
each
.
startswith
(
trans_st
)
for
trans_st
in
trans
.
possible_states
):
taste_template
.
append
(
each
+
sep
+
u
'exit;'
)
taste_template
.
append
(
u
'p{sep}{ref}{sep}exit;'
.
format
(
ref
=
each
,
sep
=
sep
))
if
input_def
:
for
inp
in
input_def
.
parameters
:
...
...
@@ -542,7 +543,7 @@ def _call_external_function(output):
out_sig
=
proc
except
ValueError
:
# Not there? Impossible, the parser would have barked
raise
ValueError
(
'Probably a bug - please report'
)
raise
ValueError
(
u
'Probably a bug - please report'
)
if
out_sig
:
list_of_params
=
[]
for
idx
,
param
in
enumerate
(
out
.
get
(
'params'
)
or
[]):
...
...
@@ -1667,8 +1668,9 @@ def _inner_procedure(proc):
VARIABLES
.
update
({
var
[
'name'
]:
(
var
[
'type'
],
None
)})
# Build the procedure signature
pi_header
=
u
'procedure p{sep}{proc_name}'
.
format
(
sep
=
UNICODE_SEP
,
proc_name
=
proc
.
inputString
)
pi_header
=
u
'procedure {sep}{proc_name}'
.
format
(
sep
=
(
u
'p'
+
UNICODE_SEP
)
if
not
proc
.
external
else
''
,
proc_name
=
proc
.
inputString
)
if
proc
.
fpar
:
pi_header
+=
'('
params
=
[]
...
...
Helper.py
View file @
da1fff7a
...
...
@@ -150,7 +150,8 @@ def flatten(process, sep=u'_'):
if
isinstance
(
trans
,
int
)):
call_entry
=
ogAST
.
ProcedureCall
()
call_entry
.
inputString
=
'entry'
call_entry
.
output
=
[{
'outputName'
:
prefix
+
u
'entry'
,
entryproc
=
u
'{pre}entry'
.
format
(
pre
=
prefix
)
call_entry
.
output
=
[{
'outputName'
:
entryproc
,
'params'
:
[],
'tmpVars'
:
[]}]
process
.
transitions
[
each
].
actions
.
insert
(
0
,
call_entry
)
...
...
@@ -161,8 +162,9 @@ def flatten(process, sep=u'_'):
if
each
.
terminator
.
kind
==
'return'
:
call_exit
=
ogAST
.
ProcedureCall
()
call_exit
.
inputString
=
'exit'
call_exit
.
output
=
[{
'outputName'
:
prefix
+
u
'exit'
,
'params'
:
[],
'tmpVars'
:
[]}]
exitproc
=
u
'{pre}exit'
.
format
(
pre
=
prefix
)
call_exit
.
output
=
[{
'outputName'
:
exitproc
,
'params'
:
[],
'tmpVars'
:
[]}]
each
.
actions
.
append
(
call_exit
)
for
inner
in
state
.
composite_states
:
...
...
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