Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
af7af71f
Commit
af7af71f
authored
Aug 05, 2019
by
yoogx
Browse files
* Adjust logic: add formal parameter to decide wether we
should exit or not. For openaadl/ocarina#224
parent
674a8f18
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core/instance/ocarina-instances.adb
View file @
af7af71f
...
...
@@ -146,7 +146,10 @@ package body Ocarina.Instances is
-- Instantiate_Model --
-----------------------
function
Instantiate_Model
(
Root
:
Node_Id
)
return
Node_Id
is
function
Instantiate_Model
(
Root
:
Node_Id
;
Exit_If_Error
:
Boolean
:=
True
)
return
Node_Id
is
pragma
Assert
(
Kind
(
Root
)
=
K_AADL_Specification
);
Root_Systems
:
Node_List
;
...
...
@@ -222,7 +225,8 @@ package body Ocarina.Instances is
if
No
(
Root_System
)
then
Error_Loc
(
1
)
:=
No_Location
;
Exit_On_Error
(
True
,
"Cannot find a root system"
);
Exit_On_Error
(
Exit_If_Error
,
"Cannot find a root system"
);
return
No_Node
;
end
if
;
if
Root_System_Name
/=
No_Name
...
...
@@ -238,7 +242,7 @@ package body Ocarina.Instances is
(
Root_System
,
False
,
True
);
DE
(
"system % is not a root system, use %"
);
Root_System
:=
No_Node
;
Exit_On_Error
(
True
,
"Cannot instantiate AADL model"
);
Exit_On_Error
(
Exit_If_Error
,
"Cannot instantiate AADL model"
);
end
if
;
end
if
;
...
...
@@ -248,7 +252,9 @@ package body Ocarina.Instances is
if
No
(
Root_System
)
then
Instance_Root
:=
No_Node
;
Exit_On_Error
(
True
,
"Cannot instantiate full model, exit now"
);
Exit_On_Error
(
Exit_If_Error
,
"Cannot instantiate full model, exit now"
);
return
No_Node
;
else
-- The first step of the instantiation consist of propagate the
-- properties declared in the AADL packages to the AADL
...
...
src/core/instance/ocarina-instances.ads
View file @
af7af71f
...
...
@@ -33,12 +33,17 @@ with Ocarina.Types; use Ocarina.Types;
package
Ocarina
.
Instances
is
function
Instantiate_Model
(
Root
:
Node_Id
)
return
Node_Id
;
function
Instantiate_Model
(
Root
:
Node_Id
;
Exit_If_Error
:
Boolean
:=
True
)
return
Node_Id
;
-- Instantiate the tree of the model and return the instantiated
-- architecture. If Root_System_Name in Ocarina.Options is set and
-- corresponds to a root system eligible for instantiation, then
-- instantiate the model from this system.
-- FIXME : not clear
-- architecture. If Root_System_Name (from Ocarina.Options) is set
-- and corresponds to a root system eligible for instantiation,
-- then instantiate the model from this system. If Exit_If_Error
-- is set to true, exit immediatly in case of an error, otherwise
-- return No_Node.
--
-- If Root_System_Name does not correspond to anything,
-- instantiate nothing. Root_System_Name is to be used when
-- several system implementations are electible.
...
...
Write
Preview
Supports
Markdown
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