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
4a80cbb6
Commit
4a80cbb6
authored
Mar 18, 2018
by
Maxime Perrotin
Browse files
Complete support of context parameters
parent
27061584
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/taste-backend-skeletons.adb
View file @
4a80cbb6
...
...
@@ -19,8 +19,9 @@ use Ada.Characters.Handling,
package
body
TASTE
.
Backend
.
Skeletons
is
procedure
Generate
(
Model
:
TASTE_Model
)
is
Output_File
:
File_Type
;
Template
:
constant
IV_As_Template
:=
All_CP_Files
:
Tag
;
-- List of Context Parameters ASN.1 files
Output_File
:
File_Type
;
Template
:
constant
IV_As_Template
:=
Interface_View_Template
(
Model
.
Interface_View
);
Prefix
:
constant
String
:=
Model
.
Configuration
.
Binary_Path
.
all
...
...
@@ -106,6 +107,7 @@ package body TASTE.Backend.Skeletons is
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
(
"ASN1_Modules"
,
Get_Module_List
);
...
...
@@ -147,7 +149,7 @@ package body TASTE.Backend.Skeletons is
CP_Tmpl
:
constant
Translate_Set
:=
CP_Template
(
F
=>
Each
);
CP_Text
:
constant
String
:=
CP_To_ASN1
(
CP_Tmpl
);
CP_File
:
constant
String
:=
"Context-"
&
To_String
(
Each
.
Name
)
&
To_Lower
(
To_String
(
Each
.
Name
)
)
&
".asn"
;
Func_Tmpl
:
constant
Func_As_Template
:=
...
...
@@ -234,6 +236,8 @@ package body TASTE.Backend.Skeletons is
Name
=>
Output_Base
&
CP_File
);
Put_Line
(
Output_File
,
CP_Text
);
Close
(
Output_File
);
All_CP_Files
:=
All_CP_Files
&
(
"../"
&
Output_Base
&
CP_File
);
end
if
;
else
Put_Info
(
"Ignoring function "
&
To_String
(
Each
.
Name
));
...
...
src/taste-parser_version.ads
View file @
4a80cbb6
package
TASTE
.
Parser_Version
is
Parser_Release
:
constant
String
:=
"
5e581c6
; Commit Date: Sun Mar 18 10:57:03 2018 "
;
"
2706158
; Commit Date: Sun Mar 18 10:57:03 2018 "
;
Ocarina_Version
:
constant
String
:=
"Ocarina 2017.x (Working Copy from r2a52334)"
;
end
TASTE
.
Parser_Version
;
\ No newline at end of file
templates/skeletons/c/body.tmplt
View file @
4a80cbb6
...
...
@@ -36,7 +36,7 @@
@@IF@@ @_Has_Context_@
/* Include Context Parameters (constants defined in the Interface View) */
#include "Context-@_
REPLACE((_)/-):
LOWER:Name_@.h"
#include "Context-@_LOWER:Name_@.h"
@@END_IF@@
void @_LOWER:Name_@_startup()
...
...
templates/skeletons/makefile.tmplt
View file @
4a80cbb6
...
...
@@ -2,6 +2,8 @@
@@--
@@-- @_Function_Names_@
:
Combined table: list of fuction names...
@@-- @_Language_@
:
... and corresponding implementation language
@@-- @_Is_Type_@
:
... and flag if it is a function type
@@-- @_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
@@-- @_ASN1_Modules_@
:
List of all ASN.1 modules
...
...
@@ -21,10 +23,10 @@ dataviews:
@@TABLE@@
@@IF@@
@_Unique_Languages_@
/=
"GUI"
@@IF@@
@_Unique_Languages_@
=
"Ada"
or
@_Unique_Languages_@
=
"SDL"
mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn
||
:
if [ ! -d dataview/Ada ]; then
mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn
@_REPLACE(,/ )
:
CP_Files_@ ; fi
cd
dataview/Ada
&&
rm
-f
gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@
@ELSIF@@ @_Unique_Languages_@
=
"C"
or @_Unique_Languages_@
=
"CPP"
mkdir
dataview/C
&&
mono
$(
shell
which asn1.exe
)
-c
-typePrefix
asn1Scc
-o
dataview/C dataview/dataview-uniq.asn
||
:
if
[
!
-d
dataview/C
]
;
then
mkdir
dataview/C
&&
mono
$(
shell
which asn1.exe
)
-c
-typePrefix
asn1Scc
-o
dataview/C dataview/dataview-uniq.asn
@_REPLACE
(
,/
)
:CP_Files_@
;
fi
@
@ELSE@@
mkdir
-p
dataview/@_Unique_Languages_@
asn2dataModel
-o
dataview/@_Unique_Languages_@
-to
@_Unique_Languages_@ dataview/dataview-uniq.asn
...
...
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