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
a54e50f5
Commit
a54e50f5
authored
Apr 20, 2015
by
yoogx
Browse files
* analyse() function now returns a boolean
For issue #30
parent
0679fb81
Changes
5
Hide whitespace changes
Inline
Side-by-side
resources/runtime/python/ocarina.py
View file @
a54e50f5
...
...
@@ -35,8 +35,8 @@ def status ():
def
reset
():
'''Reset Ocarina internal state
**Note:** this function must be called before processing a new set of
models.
'''
**Note:** this function must be called before processing a new set of
models.
'''
libocarina_python
.
reset
();
...
...
@@ -44,7 +44,7 @@ def reset ():
def
load
(
filename
):
'''Load a file
:param filename: name of the file to be loaded,
follow
ing Ocarina search path
:param filename: name of the file to be loaded,
us
ing Ocarina search path
:type filename: string
E.g. to load "foo.aadl":
...
...
@@ -57,7 +57,7 @@ def load (filename):
################################################################################
def
analyze
():
'''Analyze models'''
libocarina_python
.
analyze
();
return
libocarina_python
.
analyze
();
################################################################################
def
instantiate
(
root_system
):
...
...
@@ -311,5 +311,3 @@ def getNodeId (name):
>>> getNodeId (MyHome);
'''
return
libocarina_python
.
getNodeId
(
name
);
src/python/ocarina-python_cmd.adb
View file @
a54e50f5
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--
Copyright (C) 2014 ESA & ISAE.
--
-- Copyright (C) 2014
-2015
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -145,9 +145,10 @@ package body Ocarina.Python_Cmd is
(
Data
:
in
out
Callback_Data
'
Class
;
Command
:
String
)
is
pragma
Unreferenced
(
Command
,
Data
);
pragma
Unreferenced
(
Command
);
Result
:
constant
Boolean
:=
Ocarina
.
Utils
.
Analyze
;
begin
Ocarina
.
Utils
.
Analyze
;
Set_Return_Value
(
Data
,
Result
)
;
end
On_Analyze
;
-----------------
...
...
src/python/ocarina-utils.adb
View file @
a54e50f5
...
...
@@ -208,7 +208,7 @@ package body Ocarina.Utils is
-- Analyze --
-------------
procedure
Analyze
is
function
Analyze
return
Boolean
is
Success
:
Boolean
;
begin
Success
:=
Analyze
(
Language
,
AADL_Root
);
...
...
@@ -217,6 +217,7 @@ package body Ocarina.Utils is
else
Write_Line
(
"Model analyzed sucessfully"
);
end
if
;
return
Success
;
end
Analyze
;
-----------------
...
...
src/python/ocarina-utils.ads
View file @
a54e50f5
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--
Copyright (C) 2013 ESA & ISAE.
--
-- Copyright (C) 2013
-2015
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -49,7 +49,7 @@ package Ocarina.Utils is
-- Display status information on Ocarina
procedure
Load_AADL_File
(
Filename
:
String
);
procedure
Analyze
;
function
Analyze
return
Boolean
;
procedure
Instantiate
(
Root_System
:
String
);
procedure
Generate
(
Backend_Name
:
String
);
procedure
Reset
;
...
...
tests/python/test_ocarina.py
View file @
a54e50f5
...
...
@@ -10,7 +10,8 @@ def main ():
load
(
"rma.aadl"
);
# load a file
load
(
"deployment.aadl"
);
# load a file
analyze
();
# analyze models
result
=
analyze
();
# analyze models
print
"Analysis result %r"
%
(
result
);
instantiate
(
"rma.erc32"
);
# instantiate
generate
(
Backends
.
polyorb_hi_ada
);
...
...
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