Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
ef251076
Commit
ef251076
authored
Feb 24, 2018
by
Maxime Perrotin
Browse files
Refactor interface signature
Don't need param-specific templates anymore tested with SDL
parent
2b6944f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/taste-backend-skeletons.adb
View file @
ef251076
...
...
@@ -177,18 +177,31 @@ package body TASTE.Backend.Skeletons is
&
Assoc
(
"Interface_Kind"
,
TI
.
RCM
'
Img
)
&
Assoc
(
"Direction"
,
Param
.
Direction
'
Img
));
-- MP: With the vector tags Param_Names/Types/Directions it should be
-- possible to completely avoid the templates specific to params
-- (Result.Params is probably unnecessary now) to be confirmed
function
Interface_Template
(
TI
:
Taste_Interface
)
return
Interface_As_Template
is
use
Template_Vectors
;
Result
:
Interface_As_Template
;
Result
:
Interface_As_Template
;
Param_Names
:
Vector_Tag
;
Param_Types
:
Vector_Tag
;
Param_Directions
:
Vector_Tag
;
begin
Result
.
Header
:=
+
Assoc
(
"Name"
,
TI
.
Name
)
Result
.
Header
:=
+
Assoc
(
"Name"
,
TI
.
Name
)
&
Assoc
(
"Kind"
,
TI
.
RCM
'
Img
)
&
Assoc
(
"Parent_Function"
,
TI
.
Parent_Function
);
for
Each
of
TI
.
Params
loop
Result
.
Params
:=
Result
.
Params
&
Parameter_Template
(
Each
,
TI
);
Result
.
Params
:=
Result
.
Params
&
Parameter_Template
(
Each
,
TI
);
Param_Names
:=
Param_Names
&
Each
.
Name
;
Param_Types
:=
Param_Types
&
Each
.
Sort
;
Param_Directions
:=
Param_Directions
&
Each
.
Direction
'
Img
;
end
loop
;
Result
.
Header
:=
Result
.
Header
&
Assoc
(
"Param_Names"
,
Param_Names
)
&
Assoc
(
"Param_Types"
,
Param_Types
)
&
Assoc
(
"Param_Directions"
,
Param_Directions
);
return
Result
;
end
Interface_Template
;
...
...
templates/skeletons/sdl/interface-signature.tmplt
View file @
ef251076
...
...
@@ -3,23 +3,31 @@
@@-- @_Name_@ : The name of the interface
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Parameters_@ : The template-generated parameters
@@-- @_Parameters_@ : The template-generated parameters DEPRECATED
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@IF@@ @_LOWER:Kind_@ = "cyclic_operation" or @_LOWER:Kind_@ = "sporadic_operation"
@@IF@@ @_Parameters'Length_@ > 0
signal @_CAPITALIZE:Name_@ (@_STRIP:Parameters_@)
@@IF@@ @_Param_Names'Length_@ > 0
/* CIF Keep Specific Geode PARAMNAMES @_Param_Names_@ */
signal @_CAPITALIZE:Name_@ (@_REPLACE_ALL((-)/_):Param_Types_@)
@@ELSE@@
signal @_CAPITALIZE:Name_@
@@END_IF@@
@@ELSE@@
procedure @_CAPITALIZE:Name_@;
@@IF@@ @_Param
eter
s'Length_@ > 0
@@IF@@ @_Param
_Name
s'Length_@ > 0
fpar
@@END_IF@@
@@INLINE( )(,\n )()@@
@@TABLE@@
@_STRIP:Parameters_@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
in @_CAPITALIZE:Param_Names_@ @_REPLACE_ALL((-)/_):Param_Types_@
@@ELSE@@
in/out @_CAPITALIZE:Param_Names_@ @_REPLACE_ALL((-)/_):Param_Types_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
;
external
@@END_IF@@
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment