Commit 5757bf49 authored by Rahma BOUAZIZ's avatar Rahma BOUAZIZ Committed by yoogx
Browse files

* Complete the analysis of the Behavioral_Specification AST

        For openaadl/ocarina#189
parent 84e173b8
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -152,6 +152,7 @@ package body Ocarina.Instances is
Instance_Root : Node_Id;
Root_System : Node_Id := No_Node;
List_Node : Node_Id;
L1 : Node_List;
procedure Report_Root_Systems_To_User;
......@@ -299,6 +300,31 @@ package body Ocarina.Instances is
Ocarina.ME_AADL.AADL_Instances.Debug.W_Node_Id'Access);
end if;
-- XXX: In some cases there are some AADL Entities that are not
-- intanciated. For example a subprogram or a data that is used
-- only in the scope of a BA annex : For instance a BA variable
-- that have as Classifier_Ref a Data component that is not
-- used in other AADL components, An other case, a Subprogram
-- component called only in the scope of one or more Behavior
-- specification of other components. In these cases, we
-- instanciate these components to able to use them in the code
-- generation backend.
-- This step is probably too large, and could be restricted to
-- subprogram and data component types only.
L1 := Find_All_Declarations (Root,
(ATN.K_Component_Type,
ATN.K_Component_Implementation));
List_Node := L1.First;
while Present (List_Node) loop
if No (Default_Instance (List_Node)) then
Set_Instance (List_Node,
Instantiate_Component (Instance_Root, List_Node));
end if;
List_Node := ATN.Next_Entity (List_Node);
end loop;
return Instance_Root;
end Instantiate_Model;
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2016 ESA & ISAE. --
-- Copyright (C) 2016-2019 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -41,16 +41,21 @@ package Ocarina.Analyzer.AADL_BA is
function Is_Complete
(BA_Root : Node_Id;
State : Node_Id)
return boolean;
return Boolean;
function Is_Initial
(BA_Root : Node_Id;
State : Node_Id)
return boolean;
return Boolean;
function Is_Final
(BA_Root : Node_Id;
State : Node_Id)
return boolean;
return Boolean;
function Find_BA_Variable
(Node : Node_Id;
BA_Root : Node_Id)
return Node_Id;
end Ocarina.Analyzer.AADL_BA;
......@@ -130,6 +130,7 @@ module Ocarina::ME_AADL_BA::BA_Tree::Nodes {
Node_Id Component_Impl;
Node_Id Full_Identifier; // ex: package::comp_type.comp_impl
Node_Id Corresponding_Declaration; // AADL Declarative tree node
};
interface Behavior_Variable : Behavior_Entity {
......@@ -478,6 +479,8 @@ module Ocarina::ME_AADL_BA::BA_Tree::Nodes {
interface Parameter_Label : Behavior_Entity {
Node_Id Parameter;
boolean Is_In;
boolean Is_Out;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment