Commit 184766e6 authored by jhugues's avatar jhugues

* When invoked with the -b flag, also call cheddarlite to

          process the XML file



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@4383 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent dfd93483
......@@ -39,7 +39,9 @@ with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
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 Namet; use Namet;
......@@ -54,6 +56,8 @@ 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
......@@ -92,6 +96,27 @@ package body Ocarina.Backends.Cheddar is
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;
......@@ -104,10 +129,13 @@ package body Ocarina.Backends.Cheddar is
Generated_Sources_Directory := Get_String_Name (".");
Initialize_Option_Scan;
loop
case Getopt ("* o:") is
case Getopt ("* b o:") is
when ASCII.NUL =>
exit;
when 'b' =>
Invoke_Cheddar := True;
when 'o' =>
declare
D : constant String := Parameter;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment