------------------------------------------------------------- ------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- G A I A . P N . N U T I L S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2006-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 Gaia.Processor.Nodes; with Namet; package body Gaia.Pn.Nutils is package GPN renames Gaia.Pn.Nodes; package GN renames Gaia.Processor.Nodes; ------------------------- -- Append_Node_To_List -- ------------------------- procedure Append_Node_To_List (E : Node_Id; L : List_Id) is Last : Node_Id; use Namet; begin Last := Last_Node (L); if No (Last) then Set_First_Node (L, E); else Set_Next_Node (Last, E); end if; Last := E; while Present (Last) loop Set_Last_Node (L, Last); Last := Next_Node (Last); end loop; end Append_Node_To_List; -------------- -- New_List -- -------------- function New_List (Kind : Node_Kind) return List_Id is begin return List_Id (New_Node (Kind)); end New_List; -------------- -- Is_Empty -- -------------- function Is_Empty (L : List_Id) return Boolean is begin return L = No_List or else No (First_Node (L)); end Is_Empty; -------------- -- New_Node -- -------------- function New_Node (Kind : Node_Kind) return Node_Id is N : Node_Id; begin Entries.Increment_Last; N := Entries.Last; Entries.Table (N) := Default_Node; Set_Kind (N, Kind); return N; end New_Node; --------------------- -- Map_Scoped_Name -- --------------------- function Map_Scoped_Name (Gaia_Scoped, Corresponding : Node_Id) return Node_Id is use GN; pragma Assert (Gaia_Scoped /= No_Node and then GN.Kind (Gaia_Scoped) = GN.K_Scoped_Name); Scoped : Node_Id; Parent : Node_Id; begin Scoped := New_Node (GPN.K_Scoped_Name); GPN.Set_Identifier (Scoped, Make_Identifier (Scoped, GN.Name (GN.Identifier (Gaia_Scoped)))); GPN.Set_Reference (Scoped, Corresponding); Parent := GN.Parent_Scoped_Name (Gaia_Scoped); if Parent /= No_Node then GPN.Set_Parent_Scoped_Name (Scoped, Map_Scoped_Name (Parent, Corresponding)); else GPN.Set_Parent_Scoped_Name (Scoped, No_Node); end if; return Scoped; end Map_Scoped_Name; ------------------------ -- Translate_Position -- ------------------------ function Translate_Position (P : Node_Id) return Node_Location is use Ocarina.AADL_Values; N : Node_Location; begin N.X := Integer (Ocarina.AADL_Values.Value (X_Value (P)).IVal); N.Y := Integer (Ocarina.AADL_Values.Value (Y_Value (P)).IVal); return N; end Translate_Position; ----------------------- -- Make_Include_Call -- ----------------------- function Make_Include_Call (Gaia_Instance, Gaia_Subprogram_Call : Node_Id) return Node_Id is N : constant Node_Id := New_Node (K_Include_Call); I, I2 : Node_Id; begin I := Map_Scoped_Name (GN.Scoped_Name (Gaia_Instance), N); I2 := Map_Scoped_Name (GN.Scoped_Name (Gaia_Subprogram_Call), N); Set_Subprogram_Scoped_Name (N, I2); Set_Namespace_Scoped_Name (N, I); return N; end Make_Include_Call; ----------------------- -- Make_Include_Call -- ----------------------- function Make_Include_Call (Prefix : String; Gaia_Call : Node_Id) return Node_Id is use Ocarina.AADL_Values; use Namet; N : constant Node_Id := New_Node (K_Include_Call); Scoped : constant Node_Id := New_Node (K_Scoped_Name); I, I2 : Node_Id; begin Set_Str_To_Name_Buffer (Prefix); I2 := Make_Identifier (Scoped, Name_Find); GPN.Set_Identifier (Scoped, I2); GPN.Set_Parent_Scoped_Name (Scoped, No_Node); I := Map_Scoped_Name (GN.Scoped_Name (Gaia_Call), N); Set_Subprogram_Scoped_Name (N, I); Set_Namespace_Scoped_Name (N, Scoped); return N; end Make_Include_Call; ------------------------ -- Add_Domain_To_List -- ------------------------ procedure Add_Domain_To_List (D : Node_Id; L : List_Id) is N : constant Node_Id := New_Node (K_Encapsulate_List_Node); begin Set_Refered_Node (N, D); Append_Node_To_List (N, L); end Add_Domain_To_List; ------------------------ -- Add_Domain_To_Node -- ------------------------ procedure Add_Domain_To_Node (D, N : Node_Id; Number : Value_Id := Ocarina.AADL_Values.V_One) is L : constant Node_Id := New_Node (K_Encapsulate_List_Node); K : List_Id; P : Node_Id; Found : Boolean := False; C : Node_Id; begin if Kind (N) = K_Connect_Statement then C := Make_Colored_Token (D, Number); Set_Refered_Node (L, C); K := Domains (N); if not Is_Empty (K) then P := First_Node (K); while P /= No_Node loop if Color_Declaration (Refered_Node (P)) = D then Found := True; exit; end if; P := Next_Node (P); end loop; end if; if not Found then Append_Node_To_List (L, Domains (N)); end if; else Set_Refered_Node (L, D); K := Domains (N); if not Is_Empty (K) then P := First_Node (K); while P /= No_Node loop if Refered_Node (P) = D then Found := True; exit; end if; P := Next_Node (P); end loop; end if; if not Found then Append_Node_To_List (L, Domains (N)); end if; end if; end Add_Domain_To_Node; ------------------------ -- Make_Colored_Token -- ------------------------ function Make_Colored_Token (Color : Node_Id; Number : Value_Id := Ocarina.AADL_Values.V_One) return Node_Id is N : constant Node_Id := New_Node (K_Colored_Token); begin Set_Color_Declaration (N, Color); Set_Number (N, Number); return N; end Make_Colored_Token; ---------------------------- -- Add_Token_Value_To_Arc -- ---------------------------- procedure Add_Token_Value_To_Arc (A : Node_Id; V : Value_Id; C : Node_Id) is L : constant Node_Id := New_Node (K_Encapsulate_List_Node); T : constant Node_Id := New_Node (K_Token); begin Set_Color (T, C); Set_Value (T, V); Set_Refered_Node (L, T); Append_Node_To_List (L, Domains (A)); end Add_Token_Value_To_Arc; ------------------------ -- Make_Control_Color -- ------------------------ procedure Make_Control_Color is use Namet; use Ocarina.AADL_Values; V : constant Node_Id := New_Node (K_Color_Variable); N : constant Node_Id := New_Node (K_Color_Declaration); Name : Name_Id; begin Set_Str_To_Name_Buffer ("Control"); Name := Name_Find; GPN.Set_Identifier (N, Make_Identifier (N, Name)); GPN.Set_Scoped_Name (N, Make_Always_Scoped_Name (N, No_Node, Name)); GPN.Set_Symbolic_Values (N, New_List (K_List_Id)); Set_Str_To_Name_Buffer ("V"); Name := Name_Find; GPN.Set_Identifier (V, Make_Identifier (V, Name)); GPN.Set_Scoped_Name (V, Make_Always_Scoped_Name (V, N, Name)); GPN.Set_Color_Variable (N, V); Control_Color := N; Set_Str_To_Name_Buffer ("V"); Valid_Color_Obj := New_String_Value (Name_Find); Set_Str_To_Name_Buffer ("U"); Invalid_Color_Obj := New_String_Value (Name_Find); end Make_Control_Color; ------------------------- -- Make_Symbolic_Value -- ------------------------- function Make_Symbolic_Value (N : Value_Id) return Node_Id is V : constant Node_Id := New_Node (K_Symbolic_Value); begin Set_Value_Name (V, N); return V; end Make_Symbolic_Value; ---------------------------- -- Make_Color_Declaration -- ---------------------------- function Make_Color_Declaration (T, Parent : Node_Id) return Node_Id is use Namet; use GN; pragma Unreferenced (Parent); pragma Assert (GN.Kind (T) = GN.K_Type_Definition); V : constant Node_Id := New_Node (K_Color_Variable); N : constant Node_Id := New_Node (K_Color_Declaration); Name : Name_Id; Identifier : Node_Id; begin Identifier := Make_Identifier (N, GN.Name (GN.Identifier (T))); Set_Gaia_Node (Identifier, T); GPN.Set_Identifier (N, Identifier); GPN.Set_Scoped_Name (N, Make_Always_Scoped_Name (N, No_Node, GN.Name (GN.Identifier (T)))); GPN.Set_Symbolic_Values (N, New_List (K_List_Id)); Set_Str_To_Name_Buffer ("V"); Name := Name_Find; GPN.Set_Identifier (V, Make_Identifier (V, Name)); GPN.Set_Scoped_Name (V, Make_Always_Scoped_Name (V, N, Name)); GPN.Set_Color_Variable (N, V); return N; end Make_Color_Declaration; -------------------- -- Make_Root_Node -- -------------------- function Make_Root_Node (Dir_Name, File_Name : Name_Id) return Node_Id is Box : constant Node_Id := New_Node (GPN.K_Root_Node); begin GPN.Set_Places (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions (Box, New_List (GPN.K_List_Id)); GPN.Set_Connections (Box, New_List (GPN.K_List_Id)); GPN.Set_Loop_Declarations (Box, New_List (GPN.K_List_Id)); GPN.Set_Places_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Sub_Components (Box, New_List (GPN.K_List_Id)); Set_Directory_Name (Box, Dir_Name); Set_File_Name (Box, File_Name); Set_Color_Declarations (Box, New_List (GPN.K_List_Id)); return Box; end Make_Root_Node; -------------------- -- Make_Container -- -------------------- function Make_Container return Node_Id is Box : constant Node_Id := New_Node (GPN.K_Container); begin GPN.Set_Places (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions (Box, New_List (GPN.K_List_Id)); GPN.Set_Connections (Box, New_List (GPN.K_List_Id)); GPN.Set_Loop_Declarations (Box, New_List (GPN.K_List_Id)); GPN.Set_Places_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Sub_Components (Box, New_List (GPN.K_List_Id)); return Box; end Make_Container; ----------------------------- -- Make_Fonctionnal_Entity -- ----------------------------- function Make_Fonctionnal_Entity return Node_Id is Box : constant Node_Id := New_Node (GPN.K_Fonctionnal_Entity); begin GPN.Set_Places (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions (Box, New_List (GPN.K_List_Id)); GPN.Set_Connections (Box, New_List (GPN.K_List_Id)); GPN.Set_Loop_Declarations (Box, New_List (GPN.K_List_Id)); GPN.Set_Places_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Sub_Components (Box, New_List (GPN.K_List_Id)); GPN.Set_Begin_Node (Box, No_Node); GPN.Set_End_Node (Box, No_Node); GPN.Set_Include_Call (Box, No_Node); return Box; end Make_Fonctionnal_Entity; --------------------- -- Make_Thread_Box -- --------------------- function Make_Thread_Box return Node_Id is use Ocarina.AADL_Values; Box : constant Node_Id := New_Node (GPN.K_Thread_Box); begin GPN.Set_Places (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions (Box, New_List (GPN.K_List_Id)); GPN.Set_Connections (Box, New_List (GPN.K_List_Id)); GPN.Set_Loop_Declarations (Box, New_List (GPN.K_List_Id)); GPN.Set_Places_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Transitions_Fusions (Box, New_List (GPN.K_List_Id)); GPN.Set_Sub_Components (Box, New_List (GPN.K_List_Id)); GPN.Set_Fifos (Box, New_List (GPN.K_List_Id)); GPN.Set_Begin_Node (Box, No_Node); GPN.Set_End_Node (Box, No_Node); GPN.Set_Reset_Transition (Box, No_Node); GPN.Set_Color_Value (Box, No_Value); GPN.Set_Include_Call (Box, No_Node); return Box; end Make_Thread_Box; --------------------- -- Make_Identifier -- --------------------- function Make_Identifier (Pn_Entity : Node_Id; Ident_Name : Name_Id) return Node_Id is Identify : constant Node_Id := New_Node (K_Identifier); begin Set_Corresponding_Entity (Identify, Pn_Entity); Set_Name (Identify, Ident_Name); Set_Gaia_Node (Identify, No_Node); return Identify; end Make_Identifier; --------------------------------- -- Make_Transition_Declaration -- --------------------------------- function Make_Transition_Declaration (Suffix : Name_Id; Parent : Node_Id) return Node_Id is use Ocarina.AADL_Values; pragma Assert (Parent = No_Node or else (Kind (Parent) = K_Container or else Kind (Parent) = K_Root_Node or else Kind (Parent) = K_Fonctionnal_Entity)); Transition_Decl : constant Node_Id := New_Node (K_Transition_Declaration); Scoped : Node_Id; begin Set_Identifier (Transition_Decl, Make_Identifier (Transition_Decl, Suffix)); Scoped := Make_Scoped_Name (Transition_Decl, Suffix); Set_Parent_Scoped_Name (Scoped, Scoped_Name (Parent)); Set_Scoped_Name (Transition_Decl, Scoped); Set_Guard (Transition_Decl, No_Node); return Transition_Decl; end Make_Transition_Declaration; ------------------- -- Make_Position -- ------------------- procedure Make_Position (N : Node_Id; P : Node_Location) is use Ocarina.AADL_Values; Pos : constant Node_Id := New_Node (K_Position); begin GPN.Set_X_Value (Pos, New_Integer_Value (Unsigned_Long_Long (P.X))); GPN.Set_Y_Value (Pos, New_Integer_Value (Unsigned_Long_Long (P.Y))); GPN.Set_Position (N, Pos); end Make_Position; ---------------- -- Make_Guard -- ---------------- procedure Make_Guard (T : Node_Id; C : Node_Id; V : Node_Id; Cst : Value_Id) is pragma Assert (Kind (C) = K_Color_Declaration); pragma Assert (Kind (V) = K_Color_Variable); pragma Assert (Kind (T) = K_Transition_Declaration); use Namet; use Ocarina.AADL_Values; G : constant Node_Id := New_Node (K_Guard); begin Set_Color (G, C); Set_Variable (G, V); Set_Value (G, Cst); Set_Str_To_Name_Buffer ("<>"); Set_Operator (G, New_String_Value (Name_Find)); Set_Guard (T, G); end Make_Guard; ---------------------- -- Make_Equal_Guard -- ---------------------- procedure Make_Equal_Guard (T : Node_Id; C : Node_Id; V : Node_Id; Cst : Value_Id) is pragma Assert (Kind (C) = K_Color_Declaration); pragma Assert (Kind (V) = K_Color_Variable); pragma Assert (Kind (T) = K_Transition_Declaration); use Namet; use Ocarina.AADL_Values; G : constant Node_Id := New_Node (K_Guard); begin Set_Color (G, C); Set_Variable (G, V); Set_Value (G, Cst); Set_Str_To_Name_Buffer ("="); Set_Operator (G, New_String_Value (Name_Find)); Set_Guard (T, G); end Make_Equal_Guard; ------------------------ -- Add_Token_To_Place -- ------------------------ procedure Add_Token_To_Place (P : Node_Id; V : Value_Id; C : Node_Id) is pragma Assert (Kind (P) = K_Place_Declaration); pragma Assert (Kind (C) = K_Color_Declaration); T : constant Node_Id := New_Node (K_Token); begin Set_Value (T, V); Set_Color (T, C); Append_Node_To_List (T, Tokens (P)); end Add_Token_To_Place; --------------------------------- -- Make_Transition_Declaration -- --------------------------------- function Make_Transition_Declaration (Transition_Name : Name_Id; P : Node_Location) return Node_Id is use Ocarina.AADL_Values; Transition_Decl : Node_Id; begin Transition_Decl := New_Node (K_Transition_Declaration); GPN.Set_Identifier (Transition_Decl, Make_Identifier (Transition_Decl, Transition_Name)); Make_Position (Transition_Decl, P); Set_Guard (Transition_Decl, No_Node); return Transition_Decl; end Make_Transition_Declaration; ---------------------------- -- Make_Place_Declaration -- ---------------------------- function Make_Place_Declaration (Place_Name : Name_Id; P : Node_Location) return Node_Id is use Ocarina.AADL_Values; Place_Decl : Node_Id; begin Place_Decl := New_Node (K_Place_Declaration); GPN.Set_Identifier (Place_Decl, Make_Identifier (Place_Decl, Place_Name)); Make_Position (Place_Decl, P); Set_Domains (Place_Decl, New_List (K_List_Id)); Set_Tokens (Place_Decl, New_List (K_List_Id)); return Place_Decl; end Make_Place_Declaration; --------------------------------- -- Make_Transition_Declaration -- --------------------------------- function Make_Transition_Declaration (Transition_Name : Name_Id) return Node_Id is use Ocarina.AADL_Values; Transition_Decl : Node_Id; begin Transition_Decl := New_Node (K_Transition_Declaration); GPN.Set_Identifier (Transition_Decl, Make_Identifier (Transition_Decl, Transition_Name)); GPN.Set_Position (Transition_Decl, No_Node); Set_Guard (Transition_Decl, No_Node); return Transition_Decl; end Make_Transition_Declaration; ---------------------------- -- Make_Place_Declaration -- ---------------------------- function Make_Place_Declaration (Place_Name : Name_Id) return Node_Id is use Ocarina.AADL_Values; Place_Decl : Node_Id; begin Place_Decl := New_Node (K_Place_Declaration); GPN.Set_Identifier (Place_Decl, Make_Identifier (Place_Decl, Place_Name)); GPN.Set_Position (Place_Decl, No_Node); Set_Domains (Place_Decl, New_List (K_List_Id)); Set_Tokens (Place_Decl, New_List (K_List_Id)); return Place_Decl; end Make_Place_Declaration; --------------------------- -- Make_Fifo_Extremities -- --------------------------- function Make_Fifo_Extremities (Thread : Node_Id) return Node_Id is use Ocarina.AADL_Values; -- pragma Unreferenced (Thread); Place_Decl : Node_Id; begin Place_Decl := New_Node (K_Fifo_Extremities); Set_Pop_Transition (Place_Decl, No_Node); Set_Push_Transition (Place_Decl, No_Node); Set_Port_Reference (Place_Decl, No_Node); Set_Refered_Nodes (Place_Decl, New_List (K_List_Id)); Set_Ack_Place (Place_Decl, No_Node); Set_Thread_Color (Place_Decl, Color_Value (Thread)); Set_Thread_Reference (Place_Decl, Thread); return Place_Decl; end Make_Fifo_Extremities; ------------------------ -- Make_Embedded_Node -- ------------------------ function Make_Embedded_Node (N : Node_Id) return Node_Id is P : constant Node_Id := New_Node (K_Encapsulate_List_Node); begin Set_Refered_Node (P, N); return P; end Make_Embedded_Node; ------------------------- -- Append_Node_To_Fifo -- ------------------------- procedure Append_Node_To_Fifo (N, F : Node_Id) is pragma Assert (Kind (F) = K_Fifo_Extremities); L : List_Id; begin L := Refered_Nodes (F); Append_Node_To_List (Make_Embedded_Node (N), L); Set_Refered_Nodes (F, L); end Append_Node_To_Fifo; ------------------------ -- Make_Port_Location -- ------------------------ procedure Make_Port_Location (P : Node_Id; L : Node_Location) is N : Node_Id; begin if Refered_Nodes (P) /= No_List then N := Refered_Node (First_Node (Refered_Nodes (P))); Make_Position (N, L); end if; end Make_Port_Location; ------------------------- -- Make_Fifos_Location -- ------------------------- procedure Make_Fifos_Location (F : Node_Id; L : Node_Location) is pragma Assert (Kind (F) = K_Fifo_Extremities); List_Node : Node_Id; N : Node_Id; begin if Refered_Nodes (F) /= No_List then List_Node := First_Node (Refered_Nodes (F)); while Present (List_Node) loop N := Refered_Node (List_Node); Make_Position (N, L); Set_Refered_Node (List_Node, N); List_Node := GPN.Next_Node (List_Node); end loop; end if; end Make_Fifos_Location; ---------------------- -- Make_Scoped_Name -- ---------------------- function Make_Scoped_Name (Reference : Node_Id; Entity_Name : Name_Id) return Node_Id is Scoped : constant Node_Id := New_Node (K_Scoped_Name); begin Set_Corresponding_Entity (Scoped, Reference); Set_Identifier (Scoped, Make_Identifier (Scoped, Entity_Name)); Set_Parent_Scoped_Name (Scoped, No_Node); return Scoped; end Make_Scoped_Name; ---------------------- -- Make_Scoped_Name -- ---------------------- function Make_Scoped_Name (Reference : Node_Id; Parent : Node_Id; Entity_Name : Name_Id) return Node_Id is use Namet; use Ocarina.AADL_Values; Scoped : constant Node_Id := New_Node (K_Scoped_Name); I : Integer; Name : Name_Id; begin if Full_Naming_Policy then Set_Reference (Scoped, Reference); Set_Identifier (Scoped, Make_Identifier (Scoped, Entity_Name)); if Parent /= No_Node then Set_Parent_Scoped_Name (Scoped, Scoped_Name (Parent)); else Set_Parent_Scoped_Name (Scoped, No_Node); end if; else Set_Reference (Scoped, Reference); I := Integer (Reference); Set_Str_To_Name_Buffer (Integer'Image (I)); Name := Name_Find; Set_Identifier (Scoped, Make_Identifier (Scoped, Name)); Set_Parent_Scoped_Name (Scoped, No_Node); end if; return Scoped; end Make_Scoped_Name; ----------------------------- -- Make_Always_Scoped_Name -- ----------------------------- function Make_Always_Scoped_Name (Reference : Node_Id; Parent : Node_Id; Entity_Name : Name_Id) return Node_Id is use Namet; use Ocarina.AADL_Values; Scoped : constant Node_Id := New_Node (K_Scoped_Name); begin Set_Reference (Scoped, Reference); Set_Identifier (Scoped, Make_Identifier (Scoped, Entity_Name)); if Parent /= No_Node then Set_Parent_Scoped_Name (Scoped, Scoped_Name (Parent)); else Set_Parent_Scoped_Name (Scoped, No_Node); end if; return Scoped; end Make_Always_Scoped_Name; ------------------------------- -- Make_Connection_Statement -- ------------------------------- function Make_Connection_Statement (Source_Node, Destination_Node : Node_Id; Place_To_Transition : Boolean) return Node_Id is Connect : Node_Id; L : constant List_Id := New_List (K_List_Id); begin Connect := New_Node (K_Connect_Statement); Set_First_Reference (Connect, Source_Node); Set_Second_Reference (Connect, Destination_Node); Set_Is_Link_Place_To_Transition (Connect, Place_To_Transition); Set_Domains (Connect, L); return Connect; end Make_Connection_Statement; ----------------------- -- Make_Place_Fusion -- ----------------------- function Make_Place_Fusion (Node_1, Node_2, New_Name : Node_Id) return Node_Id is pragma Assert (New_Name /= No_Node and then GPN.Kind (New_Name) = GPN.K_Scoped_Name); pragma Assert (Node_1 /= No_Node and then GPN.Kind (Node_1) = GPN.K_Place_Declaration); pragma Assert (Node_2 /= No_Node and then GPN.Kind (Node_2) = GPN.K_Place_Declaration); Fusion : Node_Id; begin Fusion := New_Node (K_Place_Fusion); Set_First_Reference (Fusion, Node_1); Set_Second_Reference (Fusion, Node_2); Set_New_Scoped_Name (Fusion, New_Name); return Fusion; end Make_Place_Fusion; end Gaia.Pn.Nutils;