Commit 2164c999 authored by Maxime Perrotin's avatar Maxime Perrotin

Add template engine

parent 1275d362
......@@ -7,6 +7,8 @@ exec = aadl_parser
all: build
build:
if [ -d "templates-parser" ]; then cd templates-parser && git pull; else git clone https://github.com/AdaCore/templates-parser; fi
make -C templates-parser -j
ifeq ($(UNAME), Linux)
@echo "package TASTE.Parser_Version is" > src/taste-parser_version.ads.new
@echo " Parser_Release : constant String :=" >> src/taste-parser_version.ads.new
......@@ -33,7 +35,7 @@ ifeq ($(UNAME), Linux)
fi
endif
@#[ $(ARCH) == 64 ] && EXTRAFLAG="--target=x86_64-linux" ;
OCARINA_PATH=`ocarina-config --prefix` \
ADA_PROJECT_PATH=templates-parser/:${ADA_PROJECT_PATH} OCARINA_PATH=`ocarina-config --prefix` \
$(gnatpath)gprbuild -j0 -x -g $(exec) -p -P aadl_parser.gpr -XBUILD="debug" $$EXTRAFLAG
install:
......@@ -48,6 +50,6 @@ test:
@$(MAKE) -C test
clean:
rm -rf obj $(exec) *~
rm -rf obj templates-parser $(exec) *~
.PHONY: install clean build edit test
with "ocarina/ocarina";
-- with "templates_parser"; -- from libtemplates-parser11.10.1-dev
with "templates_parser";
project AADL_Parser is
......
with GNAT.OS_Lib;
with GNAT.OS_Lib, Text_IO;
use Text_IO;
with TASTE,
TASTE.AADL_Parser;
use TASTE.AADL_Parser;
TASTE.AADL_Parser,
Templates_Parser;
use TASTE.AADL_Parser,
Templates_Parser;
procedure AADL_Parser is
Model : TASTE_Model;
procedure Dump_With_Templates (Model : TASTE_Model) is
Set : Translate_Set;
Vec : Tag;
begin
Set_Tag_Separators (Start_With => "<",
Stop_With => ">");
Insert (Set,
Assoc ("Interface_View",
Model.Configuration.Interface_View.all));
Insert (Set,
Assoc ("Deployment_View",
Model.Configuration.Deployment_View.all));
Insert (Set, Assoc ("Data_View", Model.Configuration.Data_View.all));
Insert (Set, Assoc ("Output_Dir", Model.Configuration.Output_Dir.all));
for Each of Model.Configuration.Other_Files loop
Vec := Vec & Each;
end loop;
Insert (Set, Assoc ("Other_Files", Vec));
Insert (Set, Assoc ("Skeletons", Model.Configuration.Skeletons));
Insert (Set, Assoc ("Glue", Model.Configuration.Glue));
Insert (Set, Assoc ("Use_POHIC", Model.Configuration.Use_POHIC));
Insert (Set, Assoc ("Debug_Flag", Model.Configuration.Debug_Flag));
Insert (Set, Assoc ("Version", Model.Configuration.Version));
Insert (Set, Assoc ("Timer_Resolution",
Model.Configuration.Timer_Resolution));
Put_Line ("=== Template-generated debug output ===");
Put_Line (Parse ("configuration.tmplt", Set));
end Dump_With_Templates;
begin
Model := Parse_Project;
Model.Dump;
-- Model.Dump;
Dump_With_Templates (Model);
exception
when TASTE.Quit_TASTE =>
GNAT.OS_Lib.OS_Exit (1);
......
package TASTE.Parser_Version is
Parser_Release : constant String :=
"9591380 ; Commit Date: Thu Dec 21 21:29:22 2017 ";
"1275d36 ; Commit Date: Fri Dec 22 10:06:37 2017 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from r0b92ed3)";
"Ocarina 2017.x (Working Copy from rd078c54)";
end TASTE.Parser_Version;
\ No newline at end of file
-- TASTE CONFIGURATION ------------------------------------
|
|Interface View : <Interface_View>
|Deployment View : <Deployment_View>
|Data View : <Data_View>
|Other Files :
@@TABLE@@
<Other_Files>
@@END_TABLE@@
|Output Directory : <Output_Directory>
|Generate skeletons : <Skeletons>
|Generate glue : <Glue>
|Debug mode : <Debug_Flag>
|Request Version : <Version>
|Timer resolution : <Timer_Resolution>
|Use PolyORB-HI-C : <Use_POHIC>
|
-----------------------------------------------------------
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