Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
d7489203
Commit
d7489203
authored
May 05, 2019
by
Maxime Perrotin
Browse files
Iterate on the templates
parent
a26a56f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
templates/concurrency_view/aadl_4_makefile/partition.tmplt
View file @
d7489203
...
...
@@ -5,7 +5,8 @@
@@-- @_Thread_Names_@ : Tag: list of thread names
@@-- @_Node_Name_@ : Name of the node containing this partition
@@-- @_Blocks_@ : Code generated for protected functions
@@-- @_Block_Names@ : Tag: list of block (user functions) names
@@-- @_Block_Names@ : Vector Tag: list of block (user functions) names
@@-- @_Block_Languages@ : |_ Corresponding implementation language
@@-- @_Coverage_@ : True if user requested code coverage enable
@@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86)
@@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux)
...
...
templates/glue/language_wrappers/vm_if-body/function.tmplt
View file @
d7489203
...
...
@@ -34,6 +34,7 @@
* Timers : @_Timers_@
*/
#include <stdbool.h>
#include "@_LOWER:Name_@_vm_if.h"
void init_@_LOWER:Name_@()
...
...
@@ -52,6 +53,7 @@ void init_@_LOWER:Name_@()
// init function. Multiple calls are prevented by the "init" guard.
@@END_IF@@
@@TABLE@@
extern void init_@_LOWER:Sync_RIs_Parent_@();
init_@_LOWER:Sync_RIs_Parent_@();
@@END_TABLE@@
}
...
...
templates/glue/language_wrappers/vm_if-header/function.tmplt
View file @
d7489203
...
...
@@ -59,7 +59,7 @@ extern "C" {
@@IF@@ @_Language_@ = "C" or @_Language_@ = "CPP"
#include "@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "GUI"
#include "@_LOWER:Name_@
_gui_header.h" // Mmmh?
#include "@_LOWER:Name_@
.h"
@@ELSIF@@ @_Language_@ = "RTDS"
#include "glue_@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "MicroPython"
...
...
templates/glue/language_wrappers/vm_if-header/interface.tmplt
View file @
d7489203
...
...
@@ -17,7 +17,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
void
*IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len
const char
*IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len
@@ELSE@@
void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len
@@END_IF@@
...
...
templates/skeletons/c-header/function.tmplt
View file @
d7489203
...
...
@@ -35,7 +35,7 @@
#pragma once
#include "dataview-uniq.h"
#include "
../../../dataview/C/
dataview-uniq.h"
#ifdef __cplusplus
extern "C" {
...
...
templates/skeletons/makefile.tmplt
View file @
d7489203
...
...
@@ -7,6 +7,9 @@
@@-- @_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
MAKEFILE_PATH
:=
$(
abspath
$(
lastword
$(MAKEFILE_LIST)
))
OUTDIR
:=
$(
dir
$(MAKEFILE_PATH)
)
all
:
dataviews
dataviews
:
...
...
@@ -20,37 +23,32 @@ dataviews:
;
do
cat
$$f;
echo;
done
>
dataview/dataview-uniq.asn
@@END_INLINE@@
@@--
Then
generate
Dataviews
once
per
target
language
echo
@_Unique_Languages_@
@@TABLE@@
@@IF@@
@_Unique_Languages_@
/
=
"
GUI
"
@@
IF@@
@_Unique_Languages_@
=
"Ada"
or
@_Unique_Languages_@
=
"SDL"
@@SET@@
Lang
=
Ada
@@SET@@
Post
=
cd
dataview/Ada
&&
rm
-f
gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@@
ELSIF@@
@_Unique_Languages_@
=
"C"
or
@_Unique_Languages_@
=
"CPP"
or
@_Unique_Languages_@
=
"Blackbox_C"
@@SET@@
Lang
=
C
@@SE
T
@@
Post
=
# Blackboxes, C and C++ all use the same C data model
@@ELSE@
@
@@SET@@
Lang
=
@_Unique_Languages_
@
@@END_IF
@@
@@INLINE(
)(\n
)(\n)@
@
mkdir
-
p
dataview/@_Lang_@
PROJECT_CACHE
=
dataview/.cache asn2dataModel
-o
dataview/@_Lang_@
-to
@_Lang_@ dataview/dataview-uniq.asn
\
@@TABLE@@
@@IF@@
@_Unique_Languages_@
=
"
Ada"
or
@_Unique_Languages_@
=
"SDL
"
@@
SET@@
Lang
=
Ada
@@SET@@
Post
=
cd
dataview/Ada
&&
rm
-f
gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@@ELSIF@@
@_Unique_Languages_@
=
"C"
or
@_Unique_Languages_@
=
"CPP"
or
@_Unique_Languages_@
=
"Blackbox_C"
or
@_Unique_Languages_@
=
"GUI"
@@
SET@@
Lang
=
C
@@SET@@
Post
=
# Blackboxes, C, GUI, and C++ all use the same C data model
@@
EL
SE@@
@@SET@@
Lang
=
@_Unique_Languages_
@
@@END_IF@
@
@@INLINE(
)(\n
)(\n)
@@
mkdir
-p
dataview/@_Lang_
@
PROJECT_CACHE
=
dataview/.cache asn2dataModel
-
o
dataview/@_Lang_@
-to
@_Lang_@ dataview/dataview-uniq.asn
\
@@INLINE
(
)(
\\\n
)(
\n
)
@@
@@TABLE@@
@_REPLACE(,/ )
:
CP_Files_@
@@END_TABLE@@
@_Post_@
@@END_INLINE@@
@@END_IF@@
@_Post_@
@@END_INLINE@@
@@END_TABLE@@
@@--
Then
symlink
the
files
for
each
function
@@TABLE@@
@@IF@@
@_Language_@
=
"Ada"
ln -fs ${PWD}/dataview/Ada/*.ads @_LOWER
:
Function_Names_@/Ada/src
@
@ELSIF@@ @_Language_@
=
"C"
or @_Language_@
=
"CPP"
or @_Language_@
=
"GUI"
or @_Language_@
=
"Blackbox_C"
ln
-fs
${PWD}
/dataview/C/
*
.h @_LOWER:Function_Names_@/@_Language_@/src
@
@ELSIF@@ @_Language_@
=
"SDL"
@@IF@@
@_Language_@
=
"SDL"
ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER
:
Function_Names_@/@_Language_@/src
@
@ELSE@@
ln
-fs
${PWD}
/dataview/@_Language_@/
*
@_LOWER:Function_Names_@/@_Language_@/src
@
@END_IF@@
@
@END_TABLE@@
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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