Commit 591cc722 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Prepare backend logic for template processing

parent e27993af
......@@ -8,6 +8,7 @@ procedure AADL_Parser is
begin
Model := Parse_Project;
Model.Dump;
Model.Generate_Build_Script;
exception
when TASTE.Quit_TASTE =>
GNAT.OS_Lib.OS_Exit (1);
......
......@@ -11,7 +11,8 @@ with GNAT.Command_Line,
Ocarina.Namet,
Ocarina.Configuration,
Ocarina.Files,
Ocarina.Parser;
Ocarina.Parser,
TASTE.Backend.Build_Script;
use Ada.Text_IO,
Ada.Exceptions,
......@@ -180,4 +181,9 @@ package body TASTE.AADL_Parser is
Model.Configuration.Debug_Dump;
end Dump;
procedure Generate_Build_Script (Model : TASTE_Model) is
begin
TASTE.Backend.Build_Script.Generate (Model);
end Generate_Build_Script;
end TASTE.AADL_Parser;
......@@ -27,7 +27,8 @@ package TASTE.AADL_Parser is
function Parse_Project return TASTE_Model;
procedure Dump (Model : TASTE_Model);
procedure Dump (Model : TASTE_Model);
procedure Generate_Build_Script (Model : TASTE_Model);
private
function Initialize return Taste_Configuration;
......
with Text_IO,
TASTE.Templates;
use Text_IO,
TASTE.Templates;
package body TASTE.Backend.Build_Script is
procedure Generate (Model : TASTE_Model) is
begin
Put_Line ("==== Generating build script ====");
New_Set;
Tmpl_Map ("Interface_View_Path", Model.Configuration.Interface_View.all);
Tmpl_Map ("Output_Path", Model.Configuration.Output_Dir.all);
Tmpl_Map ("Generate_Code", "# TODO");
Tmpl_Map ("Zip_Code", "# TODO");
Tmpl_Map ("Functions", "# TODO \");
Tmpl_Map ("CodeCoverage", "# TODO");
Put_Line (TASTE.Templates.Generate (Model.Configuration.Binary_Path.all
& "templates/build-script.tmplt"));
end Generate;
end TASTE.Backend.Build_Script;
with TASTE.AADL_Parser;
use TASTE.AADL_Parser;
package TASTE.Backend.Build_Script is
procedure Generate (Model : TASTE_Model);
end TASTE.Backend.Build_Script;
package TASTE.Backend is
end TASTE.Backend;
package TASTE.Parser_Version is
Parser_Release : constant String :=
"fdfcaa9 ; Commit Date: Tue Jan 2 11:03:26 2018 ";
"e27993a ; Commit Date: Wed Jan 3 07:07:48 2018 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from rd078c54)";
end TASTE.Parser_Version;
\ No newline at end of file
......@@ -30,8 +30,8 @@ package body TASTE.Templates is
Tmpl_Set := Tmpl_Set & Assoc (Name, Value);
end Tmpl_Map;
function Generate (Template_File : String) return String is
(Parse (Template_File, Tmpl_Set));
function Generate (Template_Name : String) return String is
(Parse (Template_Name, Tmpl_Set));
begin
Set_Tag_Separators (Start_With => "<",
Stop_With => ">");
......
......@@ -13,7 +13,7 @@ package TASTE.Templates is
procedure Tmpl_Map (Name : String; Value : Integer);
procedure Tmpl_Map (Name : String; Value : Tag);
function Generate (Template_File : String) return String;
function Generate (Template_Name : String) return String;
private
Tmpl_Set : Translate_Set;
......
......@@ -71,19 +71,19 @@ else
OUTPUTDIR=binary.ada
fi
cd "$CWD" && \\
assert-builder-ocarina.py \\
--fast \\
--aadlv2 \\
--keep-case \\
$DEBUG_MODE \\
--interfaceView "$INTERFACEVIEW" \\
--deploymentView "$DEPLOYMENTVIEW" \\
-o "$OUTPUTDIR" \\
@@LIST@@
cd "$CWD" && \
assert-builder-ocarina.py \
--fast \
--aadlv2 \
--keep-case \
$DEBUG_MODE \
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
@@TABLE@@
<Functions>
@@END_LIST@@
<CodeCoverage> \\
@@END_TABLE@@
<CodeCoverage> \
$ORCHESTRATOR_OPTIONS
if [ -f user_init_last.sh ]
......
Supports Markdown
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