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
2652acd5
Commit
2652acd5
authored
Jan 22, 2018
by
Maxime Perrotin
Browse files
Add generation of C header file
parent
c45c2548
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/taste-backend-skeletons.adb
View file @
2652acd5
...
...
@@ -24,6 +24,9 @@ package body TASTE.Backend.Skeletons is
Hdr_Tmpl
:
constant
Translate_Set
:=
+
Assoc
(
"Name"
,
Each
.
Name
);
Func_Tmpl
:
constant
Func_As_Template
:=
Template
.
Funcs
.
Element
(
To_String
(
Each
.
Name
));
PIs
:
Tag
;
RIs
:
Tag
;
Func_Hdr
:
Translate_Set
:=
Func_Tmpl
.
Header
;
begin
Put
(
"*** Generating "
);
Put_Line
(
Parse
(
Path
&
"header-filename.tmplt"
,
Hdr_Tmpl
));
...
...
@@ -42,10 +45,15 @@ package body TASTE.Backend.Skeletons is
end
;
end
loop
;
Header
:=
Header
&
Assoc
(
"Parameters"
,
Params
);
Put_Line
(
Parse
(
Path
&
"interface-signature.tmplt"
,
Header
));
declare
PI
:
constant
String
:=
Parse
(
Path
&
"interface-signature.tmplt"
,
Header
);
begin
PIs
:=
PIs
&
PI
;
end
;
end
;
end
loop
;
Func_Hdr
:=
Func_Hdr
&
Assoc
(
"Provided_Interfaces"
,
PIs
);
for
RI
of
Func_Tmpl
.
Required
loop
declare
Header
:
Translate_Set
:=
RI
.
Header
;
...
...
@@ -60,10 +68,16 @@ package body TASTE.Backend.Skeletons is
end
;
end
loop
;
Header
:=
Header
&
Assoc
(
"Parameters"
,
Params
);
Put_Line
(
Parse
(
Path
&
"interface-signature.tmplt"
,
Header
));
declare
RI
:
constant
String
:=
Parse
(
Path
&
"interface-signature.tmplt"
,
Header
);
begin
RIs
:=
RIs
&
RI
;
end
;
end
;
end
loop
;
Func_Hdr
:=
Func_Hdr
&
Assoc
(
"Required_Interfaces"
,
RIs
);
Put_Line
(
Parse
(
Path
&
"header.tmplt"
,
Func_Hdr
));
Put
(
"*** Generating "
);
Put_Line
(
Parse
(
Path
&
"body-filename.tmplt"
,
Hdr_Tmpl
));
exception
...
...
templates/skeletons/c/header.tmplt
View file @
2652acd5
/* Header file for function @_Name_@
* Generated by TASTE on @_N
ow
_@
* Generated by TASTE on @_N
OW
_@
* DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
*/
...
...
@@ -30,4 +30,4 @@ void @_LOWER:Name_@_RI_@_Required_Interfaces_@;
extern "C" {
#endif
#endif /* __USER_CODE_H_@_UPPER:Name_@
#endif /* __USER_CODE_H_@_UPPER:Name_@
*/
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