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

Fix handling of context parameters

parent 94dcfbbb
......@@ -21,7 +21,16 @@
@@IF@@ @_Block_Instance_Of_@ = ""
${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Names_@_datamodel.asn}
@@ELSE@@
@@IF@@ @_Block_Is_Shared_Type_@
@@-- instance of a shared type stored in a shared folder
${wildcard @_Shared_Lib_Dir_@/@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
@@-- context parameters of the function type must be added too
${wildcard @_Shared_Lib_Dir_@/@_LOWER:Block_Instance_Of_@/SDL/Context*.asn}
@@ELSE@@
${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
@@-- context parameters of the function type must be added too
${wildcard ../@_LOWER:Block_Instance_Of_@/SDL/Context*.asn}
@@END_IF@@
@@END_IF@@
@@-- If the function has context parameters, add the file
${wildcard ../@_LOWER:Block_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Block_Names_@.asn}
......
......@@ -19,6 +19,7 @@ DATAVIEW_ACN :=
@@END_IF@@
DATAVIEW_AADLV1 := ${DATAVIEW_PATH}/dataview_aadlv1.aadl
DATAVIEW_AADLV2 := ${DATAVIEW_PATH}/dataview_aadlv2.aadl
TASTE_SHARED_TYPES?=${TOOL-INST}/share/SharedTypes
# Project cache folder is used to speed up all ASN.1-related processing
export PROJECT_CACHE=${HOME}/.taste_AST_cache
......@@ -62,8 +63,19 @@ dataview: dataview/C/built
@@TABLE@@
@@IF@@ @_Language_@ = SDL
@@IF@@ @_Has_Context_Param_@
# SDL function with context parameters: put them in dataview
# SDL function with context parameters: put them in dataview @_Instance_Of_@
@@IF@@ @_Instance_Of_@ /= ""
@@-- Function is an instance of a type
@@IF@@ @_Is_Shared_Type_@
@@-- function type is stored in the shared library folder
sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn ${TASTE_SHARED_TYPES}/@_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn
@@ELSE@@
sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn @_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn
@@END_IF@@
@@ELSE@@
@@-- Regular SDL function (not an instance)
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
@@END_IF@@
@@ELSE@@
# Copy the dataview to SDL function @_Function_Names_@ (no context parameters)
cp -u ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/src
......
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