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
c54dd874
Commit
c54dd874
authored
Nov 21, 2014
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend support of shared libs
parent
90670e1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
AdaGenerator.py
AdaGenerator.py
+18
-12
No files found.
AdaGenerator.py
View file @
c54dd874
...
...
@@ -185,10 +185,11 @@ def _process(process, simu=False, **kwargs):
process_level_decl
.
append
(
u'{name} : constant := {val};'
.
format
(
name
=
name
,
val
=
str
(
val
)))
# Add function allowing to trace current state as a string
#process_level_decl.append('function get_state return String;')
#process_level_decl.append('pragma export(C, get_state, "{}_state");'
# .format(process_name))
if
simu
:
# Add function allowing to trace current state as a string
process_level_decl
.
append
(
'function get_state return chars_ptr;'
)
process_level_decl
.
append
(
'pragma export(C, get_state, "{}_state");'
.
format
(
process_name
))
# Add the declaration of the runTransition procedure
process_level_decl
.
append
(
'procedure runTransition(Id: Integer);'
)
...
...
@@ -218,9 +219,12 @@ with Ada.Numerics.Generic_Elementary_Functions;
with Interfaces;
use Interfaces;
{C}
package body {process_name} is'''
.
format
(
process_name
=
process_name
,
dataview
=
asn1_modules
)]
dataview
=
asn1_modules
,
C
=
'with Interfaces.C.Strings;
\n
'
'use Interfaces.C.Strings;'
if
simu
else
''
)]
# Generate the source file (.ads) header
ads_template
=
[
'''
\
...
...
@@ -463,12 +467,14 @@ package {process_name} is'''.format(process_name=process_name,
taste_template
.
append
(
'end runTransition;'
)
taste_template
.
append
(
'
\n
'
)
# Code of the function allowing to trace current state
#taste_template.append('function get_state return String is')
#taste_template.append('begin')
#taste_template.append("return states'Image(state);")
#taste_template.append('end get_state;')
#taste_template.append('\n')
if
simu
:
# Code of the function allowing to trace current state
# Can be used when tracing the execution with MSC
taste_template
.
append
(
'function get_state return chars_ptr is'
)
taste_template
.
append
(
'begin'
)
taste_template
.
append
(
"return New_String(states'Image(state));"
)
taste_template
.
append
(
'end get_state;'
)
taste_template
.
append
(
'
\n
'
)
taste_template
.
extend
(
start_transition
)
taste_template
.
append
(
'end {process_name};'
...
...
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