------------------------------------------ -------------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . G E N E R A T O R S . P O _ H I _ C -- -- -- -- B o d y -- -- -- -- Copyright (C) 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.C_Tree.Generator; with Ocarina.Generators.PO_HI_C.Activity; with Ocarina.Generators.PO_HI_C.Main; with Ocarina.Generators.PO_HI_C.Naming; with Ocarina.Generators.PO_HI_C.Runtime; with Ocarina.Generators.PO_HI_C.Subprograms; with Ocarina.Generators.PO_HI_C.Deployment; with Ocarina.Generators.PO_HI_C.Request; with Ocarina.Generators.PO_HI_C.Types; with Ocarina.Generators.PO_HI_C.Marshallers; with Ocarina.Generators.Utils; with Ocarina.Generators.Build_Utils; package body Ocarina.Generators.PO_HI_C is use Ocarina.Generators.PO_HI_C.Activity; use Ocarina.Generators.PO_HI_C.Deployment; use Ocarina.Generators.PO_HI_C.Subprograms; use Ocarina.Generators.PO_HI_C.Main; use Ocarina.Generators.PO_HI_C.Naming; use Ocarina.Generators.PO_HI_C.Request; use Ocarina.Generators.PO_HI_C.Types; use Ocarina.Generators.PO_HI_C.Marshallers; use Ocarina.Generators.Messages; use Ocarina.Generators.C_Tree.Generator; use Ocarina.Generators.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 (HI_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 C_Tree.Generator.Generate (HI_Distributed_Application_Root); -- Generate the Makefiles Build_Utils.Makefiles.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_HI_C, "PolyORB-HI-C"); Ocarina.Generators.PO_HI_C.Runtime.Initialize; end Init; ----------- -- Reset -- ----------- procedure Reset is begin Ocarina.Generators.PO_HI_C.Runtime.Reset; end Reset; --------------------------------- -- Visit_Architecture_Instance -- --------------------------------- procedure Visit_Architecture_Instance (E : Node_Id) is begin Naming.Header_File.Visit (E); Types.Header_File.Visit (E); Deployment.Header_File.Visit (E); Request.Header_File.Visit (E); Marshallers.Header_File.Visit (E); Subprograms.Header_File.Visit (E); Activity.Header_File.Visit (E); Types.Source_File.Visit (E); Request.Source_File.Visit (E); Marshallers.Source_File.Visit (E); Deployment.Source_File.Visit (E); Activity.Source_File.Visit (E); Subprograms.Source_File.Visit (E); Naming.Source_File.Visit (E); Main.Source_File.Visit (E); -- Generate a Makefile for each node Build_Utils.Makefiles.Visit (E); end Visit_Architecture_Instance; end Ocarina.Generators.PO_HI_C;