----------------------------------- --------------------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . N U T I L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2007, 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 Locations; use Locations; with Ocarina.Nodes; use Ocarina.Nodes; with Types; use Types; package Ocarina.Nutils is function First_Homonym (N : Node_Id) return Node_Id; procedure Set_First_Homonym (N : Node_Id; V : Node_Id); 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 Is_Empty (L : List_Id) return Boolean; pragma Inline (Is_Empty); -- Return true when L is empty function Have_Modes (In_Modes : Node_Id) return Boolean; -- Return true if the In_Modes node kind 'In_Modes' has at least one -- mode. function Length (L : List_Id) return Natural; function New_Node (Kind : Node_Kind; Loc : Location) return Node_Id; -- Create a new node function New_List (Kind : Node_Kind; Loc : Location) return List_Id; -- Create a new list function Make_Annotation_Item (Annotation_Node : Node_Id; Annotation_Name : Name_Id; Annotation_Info : Node_Id) return Node_Id; function Make_Identifier (Loc : Location; Name : Name_Id; Display_Name : Name_Id; Entity : Node_Id) return Node_Id; -- Make an identifier function Make_Node_Container (Item : Node_Id; Extra_Item : Node_Id := No_Node) return Node_Id; -- Creates a container for the nodes Item and Extra_Item to be able -- to put one node in several lists function Split_Name (N : Node_Id) return List_Id; -- Starting from a namespace node N whose name is in the form -- n1::n2::..., return a list of identifiers whose names are n1, -- n2...Return a null list if N has no name function Get_Parent_Package_Name (Pkg : Node_Id) return Name_Id; -- Return the name of the parent package of the package -- Pkg. Return No_Name if P has no parent package name. The -- returned name is in lower case. procedure Reset_Nodes; -- Reset the table that contains the nodes. Beware that everything -- will be lost. function Compute_Full_Name_Of_Instance (Instance : Node_Id; Display_Name : Boolean := False; Keep_Root_System : Boolean := True) return Name_Id; -- Return the complete name (i.e. containing the names of the -- parent components) of a given component instance. If the -- Display_Name flag is set, return the display name (any upper -- case charecters will be conserved. If Keep_Root_System is set -- to false, the heading root system name will be removed from the -- full name. end Ocarina.Nutils;