------------------------------------------------------------------- ------------- -- -- -- OCARINA COMPONENTS -- -- -- -- G A I A . P R O C E S S O R . N O D E S . U T I L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2006, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ with Gaia.Processor.Nodes; use Gaia.Processor.Nodes; package Gaia.Processor.Nodes.Utils is Sync_Update_Policy : Name_Id; Async_Update_Policy : Name_Id; procedure Init_Variables; -- Initialize the global variables procedure Append_List_To_List (S : List_Id; D : in out List_Id); pragma Inline (Append_List_To_List); -- Append list S to list D, if D does not exist, then D := S procedure Push_Node_To_List (E : Node_Id; L : List_Id); -- Add node N to the front of list L procedure Append_Node_To_List (E : Node_Id; L : List_Id); -- Append node N to list L (to the end of list L) procedure Remove_Node_From_List (E : Node_Id; L : List_Id); -- Remove node N to list L. function Remove_Last_Node_From_List (L : List_Id) return Node_Id; -- Remove the last node from list L, return the removed node -- Return No_Node if L does not exists or is empty. function New_Node (Kind : Node_Kind) return Node_Id; -- Create a new node function New_List (Kind : Node_Kind) return List_Id; -- Create a new list function Is_Empty (L : List_Id) return Boolean; function Build_Namespace_Name (Namespace : Node_Id) return Name_Id; -- If the namespace is unnamed, return the conventional name -- ('Partition') Else, append the namespace name to the -- conventional name. function Build_Package_Name (S : Node_Id) return Name_Id; -- If the scoped name is null, return the conventional name -- ('Partition') Else, append the full name of S to the -- conventional name function Make_Identifier (Name : Name_Id) return Node_Id; -- Makes an identifier from a name id. procedure Bind_Identifier_To_Entity (I : Node_Id; E : Node_Id); -- Set I as the Identifier of E and E as the corresponding entity -- of I. function Map_Scoped_Name (Referenced, AADL_Instance : Node_Id; Rewind : Boolean := True) return Node_Id; -- There are two kinds of scoped names: -- 1) Scoped names of Data and Supprogram componets for which the -- scopes are the namespace scopes. -- 2) Scoped names for Processes, Ports, Threads (API dependant -- entities) for which the Scopes are the components -- themselves. -- The Rewind flag indicates wether we have to get the name for -- the current instance (Flase) or for the corresponding -- Subcomponent (True). function Map_Namespace_Scoped_Name (Referenced : Node_Id; Namespace : Node_Id) return Node_Id; -- Makes a scoped name for a namespace function Append_Scoped_Name (Scoped, Referenced : Node_Id; Ident_Name : Name_Id) return Node_Id; -- Add a scoped name node to a pre-existing Scoped_Node Used when -- need to create new links which dosen't exist In the instance -- tree. function Gaia_Fully_Qualified_Name (S : Node_Id; Separator : String := "_") return Name_Id; -- Returns the full corresponding to the scoped name S. The names -- are separated by Separator. function Partition_Name return Name_Id; -- Returns the conventional name of the package corresponding to -- the unnamed AADL namespace. end Gaia.Processor.Nodes.Utils;