From c77bf46dfa8414acf400e1ec22f150fcc36ebe0e Mon Sep 17 00:00:00 2001 From: yoogx Date: Tue, 19 May 2015 22:21:35 +0200 Subject: [PATCH] * Create directory used for "-o" command line flag, for issue #34 * Suppress the invokation of "cheddarlite" when -b is set, this is no longer supported --- src/backends/ocarina-backends-cheddar.adb | 31 +++-------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/backends/ocarina-backends-cheddar.adb b/src/backends/ocarina-backends-cheddar.adb index 1b313cff..97a31fc1 100644 --- a/src/backends/ocarina-backends-cheddar.adb +++ b/src/backends/ocarina-backends-cheddar.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2010-2014 ESA & ISAE. -- +-- Copyright (C) 2010-2015 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -41,7 +41,6 @@ with Ocarina.Backends.XML_Tree.Nutils; with Ocarina.Backends.XML_Tree.Generator; with GNAT.Command_Line; use GNAT.Command_Line; -with GNAT.OS_Lib; use GNAT.OS_Lib; with Ocarina.Namet; use Ocarina.Namet; @@ -56,8 +55,6 @@ package body Ocarina.Backends.Cheddar is package XTU renames Ocarina.Backends.XML_Tree.Nutils; Generated_Sources_Directory : Name_Id := No_Name; - Invoke_Cheddar : Boolean := False; - Cheddarlite_Path : String_Access; procedure Visit_Architecture_Instance (E : Node_Id); -- Most top level visitor routine. E is the root of the AADL @@ -90,33 +87,14 @@ package body Ocarina.Backends.Cheddar is Display_Error ("XML generation failed", Fatal => True); end if; + Create_Directory (Generated_Sources_Directory); + Enter_Directory (Generated_Sources_Directory); -- Create the XML file XML_Tree.Generator.Generate (XML_Root); - if Invoke_Cheddar then - if Cheddarlite_Path = null then - Cheddarlite_Path := Locate_Exec_On_Path ("cheddarlite"); - end if; - - declare - Args : GNAT.OS_Lib.Argument_List (1 .. 4); - Success : Boolean; - begin - Args (1) := new String'("-file"); - Args (2) := new String'("rma_impl_cheddar.xml"); - Args (3) := new String'("-request"); - Args (4) := new String'("all"); - - Spawn (Cheddarlite_Path.all, Args, Success); - if not Success then - raise Program_Error; - end if; - end; - end if; - Leave_Directory; end Generate; @@ -133,9 +111,6 @@ package body Ocarina.Backends.Cheddar is when ASCII.NUL => exit; - when 'b' => - Invoke_Cheddar := True; - when 'o' => declare D : constant String := Parameter;