--------------------------------------------------------- ----------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . P N . P R I N T E R . C O M P O N E N T S -- -- -- -- B o d y -- -- -- -- Copyright (C) 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 Output; with Namet; with Ocarina.PN.Nodes; with Ocarina.PN.Printer; with Ocarina.PN.Nutils; package body Ocarina.PN.Printer.Components is procedure Print_Thread_Port (Port : Types.node_id); ---------------------- -- Print_Thread_Box -- ---------------------- procedure Print_Thread_Box (Box : Types.node_id) is use Types; use Namet; use Output; use Ocarina.PN.Nodes; use Ocarina.PN.Printer; use Ocarina.PN.Nutils; pragma assert (Box /= No_Node and then Kind (Box) = k_thread_box); List_Node : node_id; begin Write_Eol; Write_Str ("-- Thread "); Write_Line (Get_Name_String (Name (Identifier (Box)))); Write_Line ("--"); Print_Place_Declaration (Begin_Node (Box)); Print_Place_Declaration (End_Node (Box)); Print_Transition_Declaration (Body_Transition (Box)); if Reset_Transition (Box) /= No_Node then Print_Transition_Declaration (Reset_Transition (Box)); end if; if Ack_Place (Box) /= No_Node then Print_Place_Declaration (Ack_Place (Box)); Print_PN_Connection (Ack_Link (Box)); end if; -- ports if not Is_Empty (Ports (Box)) then List_Node := First_Node (Ports (Box)); while List_Node /= No_Node loop Print_Thread_Port (List_Node); List_Node := Next_Node (List_Node); end loop; end if; -- connections between places and transitions if not Is_Empty (Arcs (Box)) then List_Node := First_Node (Arcs (Box)); while List_Node /= No_Node loop Print_PN_Connection (List_Node); List_Node := Next_Node (List_Node); end loop; end if; Write_Str ("-- End of thread "); Write_Line (Get_Name_String (Name (Identifier (Box)))); end Print_Thread_Box; ----------------------- -- Print_Thread_Port -- ----------------------- procedure Print_Thread_Port (Port : Types.node_id) is use Ocarina.PN.Printer; use Ocarina.PN.Nodes; begin Print_Place_Declaration (Port); end Print_Thread_Port; end Ocarina.PN.Printer.Components;