--------------------------------------- ----------------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . G E N E R A T O R S . P O _ Q O S _ A D A -- -- -- -- 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 Ocarina.Generators.Messages; with Ocarina.Generators.Ada_Tree.Generator; with Ocarina.Generators.PO_QoS_Ada.Runtime; with Ocarina.Generators.PO_QoS_Ada.Main; with Ocarina.Generators.PO_QoS_Ada.Helpers; with Ocarina.Generators.PO_QoS_Ada.Servants; with Ocarina.Generators.PO_QoS_Ada.Parameters; with Ocarina.Generators.PO_QoS_Ada.Obj_Adapters; with Ocarina.Generators.PO_QoS_Ada.Setup; with Ocarina.Generators.PO_QoS_Ada.Namespaces; with Ocarina.Generators.Utils; with Ocarina.Generators.Build_Utils; package body Ocarina.Generators.PO_QoS_Ada is use Ocarina.Generators.Messages; use Ocarina.Generators.Ada_Tree.Generator; use Ocarina.Generators.PO_QoS_Ada.Runtime; use Ocarina.Generators.Utils; use Ocarina.Generators.Build_Utils; procedure Visit_Architecture_Instance (E : Node_Id); -- Most top level visitor routine. E is the root of the AADL -- instance tree. The procedure does a traversal for each -- compilation unit to be generated. -------------- -- Generate -- -------------- procedure Generate (Instance_Root : Node_Id; Options : Generator_Options := Default_Options) is begin Visit_Architecture_Instance (Instance_Root); -- Abort if the construction of the Ada tree failed if No (QoS_Distributed_Application_Root) then Display_Error ("Code generation failed", Fatal => True); end if; -- At this point, we have a valid Ada tree, we can begin the -- Ada source file generation. -- Enter the output directory Enter_Directory (Options.Output_Directory); -- Create the source files Ada_Tree.Generator.Generate (QoS_Distributed_Application_Root); -- Generate the Makefiles Build_Utils.Makefiles.Generate (Instance_Root); -- Generate the Ada project files Build_Utils.Ada_Project_Files.Generate (Instance_Root); -- If the user requested to build the applications then we -- build it. if Options.Build then Build_Utils.Makefiles.Build (Instance_Root); end if; -- Leave the output directory Leave_Directory; end Generate; ---------- -- Init -- ---------- procedure Init is begin -- Registration of the generator Register_Generator (Generate'Access, PolyORB_QoS_Ada, "PolyORB-QoS-Ada"); -- Initialize some units Ocarina.Generators.PO_QoS_Ada.Runtime.Initialize; end Init; ----------- -- Reset -- ----------- procedure Reset is begin Ocarina.Generators.PO_QoS_Ada.Runtime.Reset; end Reset; --------------------------------- -- Visit_Architecture_Instance -- --------------------------------- procedure Visit_Architecture_Instance (E : Node_Id) is begin -- Create the specs subtrees Namespaces.Package_Spec.Visit (E); Helpers.Package_Spec.Visit (E); Servants.Package_Spec.Visit (E); Parameters.Package_Spec.Visit (E); Obj_Adapters.Package_Spec.Visit (E); Setup.Package_Spec.Visit (E); -- Create the bodies subtrees Namespaces.Package_Body.Visit (E); Helpers.Package_Body.Visit (E); Servants.Package_Body.Visit (E); Parameters.Package_Body.Visit (E); Setup.Package_Body.Visit (E); Main.Subprogram_Body.Visit (E); -- The makefiles Build_Utils.Makefiles.Visit (E); -- The Ada project files Build_Utils.Ada_Project_Files.Visit (E); end Visit_Architecture_Instance; end Ocarina.Generators.PO_QoS_Ada;