Skip to content

Commit

Permalink
* Create directory used for "-o" command line flag, for issue #34
Browse files Browse the repository at this point in the history
        * Suppress the invokation of "cheddarlite" when -b is set,
          this is no longer supported
  • Loading branch information
yoogx committed May 19, 2015
1 parent 22e0fbf commit c77bf46
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions src/backends/ocarina-backends-cheddar.adb
Original file line number Diff line number Diff line change
Expand Up @@ -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 --
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit c77bf46

Please sign in to comment.