Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
62beb57f
Commit
62beb57f
authored
Apr 11, 2014
by
yoogx
Browse files
* Package Ocarina Python API
parent
28f3a440
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
62beb57f
...
...
@@ -406,8 +406,9 @@ AC_OUTPUT([
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
...
...
resources/runtime/Makefile.am
View file @
62beb57f
SUBDIRS
=
cheddar aadl_xml
SUBDIRS
=
cheddar aadl_xml
python
@DEBUG_FALSE@
DEBUG_FLAG
=
--disable-debug
@DEBUG_TRUE@
DEBUG_FLAG
=
--enable-debug
...
...
resources/runtime/python/Makefile.am
0 → 100644
View file @
62beb57f
AUTOMAKE_OPTIONS
=
no-dependencies
PYTHON_FILES
=
$(srcdir)
/ocarina.py
EXTRA_DIST
=
$(PYTHON_FILES)
ocarina_python
=
${
shell
$(CYGPATH_U)
'
$(includedir)
/ocarina/runtime/python'
}
install-data-local
:
$(INSTALL)
-d
$(DESTDIR)$(ocarina_python)
for
f
in
$(PYTHON_FILES)
;
do
$(INSTALL)
-m
444
$$
f
$(DESTDIR)$(ocarina_python)
;
done
resources/runtime/python/ocarina.py
0 → 100755
View file @
62beb57f
#! /usr/bin/python
'''Python binding to the Ocarina AADL processor'''
################################################################################
import
libocarina_python
;
# Ocarina bindings
################################################################################
def
version
():
'''Print Ocarina version'''
libocarina_python
.
version
();
################################################################################
def
status
():
'''Print Ocarina status'''
libocarina_python
.
status
();
################################################################################
def
load
(
filename
):
'''Load a file'''
libocarina_python
.
load
(
filename
);
################################################################################
def
analyze
():
'''Analyze models'''
libocarina_python
.
analyze
();
################################################################################
def
instantiate
(
root_system
):
'''Instantiate models'''
libocarina_python
.
instantiate
(
root_system
);
################################################################################
def
generate
(
generator
):
'''Generate code'''
libocarina_python
.
generate
(
generator
);
################################################################################
def
main
():
'''Test function'''
load
(
"rma.aadl"
);
# load a file
load
(
"deployment.aadl"
);
# load a file
analyze
();
# analyze models
instantiate
(
"rma.erc32"
);
# instantiate
generate
(
"polyorb_hi_ada"
);
# generate code
if
__name__
==
"__main__"
:
main
()
sys
.
exit
(
0
);
# exit
################################################################################
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