------------------------------------- ------------------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- OCARINA.DIA.PARSER.TRANSLATE.FEATURES -- -- -- -- B o d y -- -- -- -- Copyright (C) 2005-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 Ada.Text_IO; use Ada.Text_IO; with Namet; with Ocarina.Dia.Parser.Core.Ports; with Ocarina.Builder.Components.Features; package body Ocarina.Dia.Parser.Translate.Features is ------------------- -- Create_Ports -- ------------------- procedure Create_Ports (Ocarina_Node : Types.Node_Id; Dia_Node : Ocarina.Dia.Parser.Core.Node) is use Ocarina.Dia.Parser.Core; use Ocarina.Dia.Parser.Core.Ports; use Ocarina.Builder.Components.Features; I : Integer; P : Port := null; Name : Types.Name_Id; Identifier : Types.Node_Id; PN : Types.Node_Id := 0; -- pragma Warnings (off, PN); begin if not Has_Ports (Dia_Node) then Put_Line ("No Port"); else I := 1; loop P := Get_Port (Dia_Node, I); exit when P = null; if P.Port_Type_Arg /= Point then Namet.Set_Str_To_Name_Buffer (Get_Port_Declaration (P)); Name := Namet.Name_Find; Identifier := Get_Identifier (No_Node, Name); end if; case P.Port_Type_Arg is when Point => -- todo Put_Line ("Point"); when Access_Provider => -- todo Put_Line ("Access Provider todo"); when Access_Requirer => -- todo Put_Line ("Access Requirer todo"); when In_Data_Port => Put_Line ("In Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, False, True, False, False); when In_Event_Port => Put_Line ("In Event Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, False, False, True, False); when In_Event_Data_Port => Put_Line ("In Event Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, False, True, True, False); when Out_Data_Port => Put_Line ("Out Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, False, True, True, False, False); when Out_Event_Port => Put_Line ("Out Event Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, False, True, False, True, False); when Out_Event_Data_Port => Put_Line ("Out Event Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, False, True, True, True, False); when In_Out_Data_Port => Put_Line ("In Out Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, True, True, False, False); when In_Out_Event_Port => Put_Line ("In Out Event Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, True, False, True, False); when In_Out_Event_Data_Port => Put_Line ("In Out Event Data Port " & Get_Port_Declaration (P)); PN := Add_New_Port_Spec (L, Identifier, Ocarina_Node, True, True, True, True, False); when Port_Group => Put_Line ("Port Group skipped"); -- PN := Add_New_Port_Group_Spec -- (L, Identifier, Ocarina_Node, False); -- todo end case; if PN = 0 and then P.Port_Type_Arg /= Point then Put_Line ("Port wrong created"); end if; I := I + 1; end loop; end if; -- todo ajouter un retour pour verifs end Create_Ports; end Ocarina.Dia.Parser.Translate.Features;