Commit ede5b52e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete support of SDL context params

parent 6452b835
......@@ -69,8 +69,9 @@ package body TASTE.Backend.Code_Generators is
Output_File : File_Type;
Languages : Set;
Unique_Languages : Tag;
Functions_Tag : Vector_Tag;
Language_Tag : Vector_Tag;
Functions_Tag,
Language_Tag,
Has_Context_Param_Tag,
Is_Type_Tag : Vector_Tag;
Content_Set : Translate_Set;
Tmplt : constant String := Prefix_Skeletons
......@@ -84,18 +85,21 @@ package body TASTE.Backend.Code_Generators is
Functions_Tag := Functions_Tag & Each.Name;
Language_Tag := Language_Tag & Language_Spelling (Each);
Is_Type_Tag := Is_Type_Tag & Each.Is_Type;
Has_Context_Param_Tag := Has_Context_Param_Tag
& (not Each.Context_Params.Is_Empty);
end loop;
for Each of Languages loop
Unique_Languages := Unique_Languages & To_String (Each);
end loop;
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 ("ACN_Files", Get_ACN_File_List)
& Assoc ("ASN1_Modules", Get_Module_List);
Content_Set := +Assoc ("Function_Names", Functions_Tag)
& Assoc ("Language", Language_Tag)
& Assoc ("Is_Type", Is_Type_Tag)
& Assoc ("CP_Files", All_CP_Files)
& Assoc ("Has_Context_Param", Has_Context_Param_Tag)
& Assoc ("Unique_Languages", Unique_Languages)
& Assoc ("ASN1_Files", Get_ASN1_File_List)
& Assoc ("ACN_Files", Get_ACN_File_List)
& Assoc ("ASN1_Modules", Get_Module_List);
Put_Debug ("Generating global Makefile");
Create (File => Output_File,
Mode => Out_File,
......
......@@ -3,6 +3,7 @@
@@-- @_Function_Names_@ : Combined table: list of fuction names...
@@-- @_Language_@ : ... and corresponding implementation language
@@-- @_Is_Type_@ : ... and flag if it is a function type
@@-- @_Has_Context_Param_@ : ... and flag to indicate if function has context parameters
@@-- @_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
......@@ -208,13 +209,18 @@ dataview/Ada/built: ${DATAVIEW_UNIQ} ${CP_FILES}
mkdir -p $(dir $@)
asn2dataModel -o $(dir $@) -toAda $^
touch $@
cd dataview/Ada
rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@@END_IF@@
@@-- Then symlink the files for each function
@@TABLE@@
@@IF@@ @_Language_@ = "SDL"
ln -fs ../../../$^ @_LOWER:Function_Names_@/@_Language_@/src
@@IF@@ @_Has_Context_Param_@
# SDL function with context parameters: put them in dataview
sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn
@@ELSE@@
# Copy the dataview to SDL function @_Function_Names_@ (no context parameters)
cp -u ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/src
@@END_IF@@
@@END_IF@@
@@END_TABLE@@
......
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