Commit 4a80cbb6 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete support of context parameters

parent 27061584
......@@ -19,8 +19,9 @@ use Ada.Characters.Handling,
package body TASTE.Backend.Skeletons is
procedure Generate (Model : TASTE_Model) is
Output_File : File_Type;
Template : constant IV_As_Template :=
All_CP_Files : Tag; -- List of Context Parameters ASN.1 files
Output_File : File_Type;
Template : constant IV_As_Template :=
Interface_View_Template (Model.Interface_View);
Prefix : constant String := Model.Configuration.Binary_Path.all
......@@ -106,6 +107,7 @@ package body TASTE.Backend.Skeletons is
Content_Set := +Assoc ("Function_Names", Functions_Tag)
& Assoc ("Language", Language_Tag)
& Assoc ("Is_Type", Is_Type_Tag)
& Assoc ("CP_Files", All_CP_Files)
& Assoc ("Unique_Languages", Unique_Languages)
& Assoc ("ASN1_Files", Get_ASN1_File_List)
& Assoc ("ASN1_Modules", Get_Module_List);
......@@ -147,7 +149,7 @@ package body TASTE.Backend.Skeletons is
CP_Tmpl : constant Translate_Set := CP_Template (F => Each);
CP_Text : constant String := CP_To_ASN1 (CP_Tmpl);
CP_File : constant String := "Context-"
& To_String (Each.Name)
& To_Lower (To_String (Each.Name))
& ".asn";
Func_Tmpl : constant Func_As_Template :=
......@@ -234,6 +236,8 @@ package body TASTE.Backend.Skeletons is
Name => Output_Base & CP_File);
Put_Line (Output_File, CP_Text);
Close (Output_File);
All_CP_Files :=
All_CP_Files & ("../" & Output_Base & CP_File);
end if;
else
Put_Info ("Ignoring function " & To_String (Each.Name));
......
package TASTE.Parser_Version is
Parser_Release : constant String :=
"5e581c6 ; Commit Date: Sun Mar 18 10:57:03 2018 ";
"2706158 ; Commit Date: Sun Mar 18 10:57:03 2018 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from r2a52334)";
end TASTE.Parser_Version;
\ No newline at end of file
......@@ -36,7 +36,7 @@
@@IF@@ @_Has_Context_@
/* Include Context Parameters (constants defined in the Interface View) */
#include "Context-@_REPLACE((_)/-):LOWER:Name_@.h"
#include "Context-@_LOWER:Name_@.h"
@@END_IF@@
void @_LOWER:Name_@_startup()
......
......@@ -2,6 +2,8 @@
@@--
@@-- @_Function_Names_@ : Combined table: list of fuction names...
@@-- @_Language_@ : ... and corresponding implementation language
@@-- @_Is_Type_@ : ... and flag if it is a function type
@@-- @_CP_Files_@ : List of all context parameters ASN.1 files
@@-- @_Unique_Languages_@ : List of all languages used in the system
@@-- @_ASN1_Files_@ : List of all ASN.1 files
@@-- @_ASN1_Modules_@ : List of all ASN.1 modules
......@@ -21,10 +23,10 @@ dataviews:
@@TABLE@@
@@IF@@ @_Unique_Languages_@ /= "GUI"
@@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn || :
if [ ! -d dataview/Ada ]; then mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn @_REPLACE(,/ ):CP_Files_@ ; fi
cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP"
mkdir dataview/C && mono $(shell which asn1.exe) -c -typePrefix asn1Scc -o dataview/C dataview/dataview-uniq.asn || :
if [ ! -d dataview/C ]; then mkdir dataview/C && mono $(shell which asn1.exe) -c -typePrefix asn1Scc -o dataview/C dataview/dataview-uniq.asn @_REPLACE(,/ ):CP_Files_@ ; fi
@@ELSE@@
mkdir -p dataview/@_Unique_Languages_@
asn2dataModel -o dataview/@_Unique_Languages_@ -to@_Unique_Languages_@ dataview/dataview-uniq.asn
......
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