Commit b0b8d5e7 authored by Bechir Zalila's avatar Bechir Zalila
Browse files

* (ocarina-builder-aadl-components-subcomponents.ad?): New parameter

	Entity_ref for Add_New Subcomponent.

	* (ocarina-me_aadl-aadl_tree-nutils.ad?): New function Length for
	Node_List type.

	(By Wafa Gabsi)
parent 7ed9be5f
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2016 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- --
......@@ -73,7 +73,8 @@ package body Ocarina.Builder.AADL.Components.Subcomponents is
Category : Ocarina.ME_AADL.Component_Category;
Is_Refinement : Boolean := False;
In_Modes : Node_Id := No_Node;
Prototypes_Bindings : List_Id := No_List) return Node_Id
Prototypes_Bindings : List_Id := No_List;
Entity_Ref : Node_Id := No_Node) return Node_Id
is
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
......@@ -96,6 +97,7 @@ package body Ocarina.Builder.AADL.Components.Subcomponents is
Set_In_Modes (Node, In_Modes);
Set_Property_Scope (Node, New_Node (K_Scope_Definition, Loc));
Set_Corresponding_Entity (Property_Scope (Node), Node);
Set_Entity_Ref (Node, Entity_Ref);
Set_Prototype_Bindings (Node, Prototypes_Bindings);
if Prototypes_Bindings /= No_List then
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2016 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- --
......@@ -48,7 +48,8 @@ package Ocarina.Builder.AADL.Components.Subcomponents is
Category : Ocarina.ME_AADL.Component_Category;
Is_Refinement : Boolean := False;
In_Modes : Node_Id := No_Node;
Prototypes_Bindings : List_Id := No_List) return Node_Id;
Prototypes_Bindings : List_Id := No_List;
Entity_Ref : Node_Id := No_Node) return Node_Id;
-- Create and add a new subcomponent into a component
-- implementation. Loc is the location of the subcomponent in the
-- parsed text. Name references an identifier which contains the
......@@ -58,5 +59,7 @@ package Ocarina.Builder.AADL.Components.Subcomponents is
-- a refinement or not. In_Modes contains the list of the modes
-- associated to the connection. Return the Node_Id of the newly
-- created subcomponent if everything went right, else No_Node.
-- Entity_Ref indicates the entity referenced by the created
-- subcomponent.
end Ocarina.Builder.AADL.Components.Subcomponents;
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 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- --
......@@ -245,6 +245,21 @@ package body Ocarina.ME_AADL.AADL_Tree.Nutils is
return C;
end Length;
function Length (L : Node_List) return Natural is
N : Node_Id;
C : Natural := 0;
begin
if Present (L.First) then
N := L.First;
while Present (N) loop
C := C + 1;
N := Next_Entity (N);
end loop;
end if;
return C;
end Length;
---------------------
-- Make_Identifier --
---------------------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 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- --
......@@ -80,6 +80,7 @@ package Ocarina.ME_AADL.AADL_Tree.Nutils is
-- mode.
function Length (L : List_Id) return Natural;
function Length (L : Node_List) return Natural;
function New_Node (Kind : Node_Kind; Loc : Location) return Node_Id;
-- Create a new node
......
Markdown is supported
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