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
591cc722
Commit
591cc722
authored
Jan 03, 2018
by
Maxime Perrotin
Browse files
Prepare backend logic for template processing
parent
e27993af
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/aadl_parser.adb
View file @
591cc722
...
...
@@ -8,6 +8,7 @@ procedure AADL_Parser is
begin
Model
:=
Parse_Project
;
Model
.
Dump
;
Model
.
Generate_Build_Script
;
exception
when
TASTE
.
Quit_TASTE
=>
GNAT
.
OS_Lib
.
OS_Exit
(
1
);
...
...
src/taste-aadl_parser.adb
View file @
591cc722
...
...
@@ -11,7 +11,8 @@ with GNAT.Command_Line,
Ocarina
.
Namet
,
Ocarina
.
Configuration
,
Ocarina
.
Files
,
Ocarina
.
Parser
;
Ocarina
.
Parser
,
TASTE
.
Backend
.
Build_Script
;
use
Ada
.
Text_IO
,
Ada
.
Exceptions
,
...
...
@@ -180,4 +181,9 @@ package body TASTE.AADL_Parser is
Model
.
Configuration
.
Debug_Dump
;
end
Dump
;
procedure
Generate_Build_Script
(
Model
:
TASTE_Model
)
is
begin
TASTE
.
Backend
.
Build_Script
.
Generate
(
Model
);
end
Generate_Build_Script
;
end
TASTE
.
AADL_Parser
;
src/taste-aadl_parser.ads
View file @
591cc722
...
...
@@ -27,7 +27,8 @@ package TASTE.AADL_Parser is
function
Parse_Project
return
TASTE_Model
;
procedure
Dump
(
Model
:
TASTE_Model
);
procedure
Dump
(
Model
:
TASTE_Model
);
procedure
Generate_Build_Script
(
Model
:
TASTE_Model
);
private
function
Initialize
return
Taste_Configuration
;
...
...
src/taste-backend-build_script.adb
0 → 100644
View file @
591cc722
with
Text_IO
,
TASTE
.
Templates
;
use
Text_IO
,
TASTE
.
Templates
;
package
body
TASTE
.
Backend
.
Build_Script
is
procedure
Generate
(
Model
:
TASTE_Model
)
is
begin
Put_Line
(
"==== Generating build script ===="
);
New_Set
;
Tmpl_Map
(
"Interface_View_Path"
,
Model
.
Configuration
.
Interface_View
.
all
);
Tmpl_Map
(
"Output_Path"
,
Model
.
Configuration
.
Output_Dir
.
all
);
Tmpl_Map
(
"Generate_Code"
,
"# TODO"
);
Tmpl_Map
(
"Zip_Code"
,
"# TODO"
);
Tmpl_Map
(
"Functions"
,
"# TODO \"
);
Tmpl_Map
(
"CodeCoverage"
,
"# TODO"
);
Put_Line
(
TASTE
.
Templates
.
Generate
(
Model
.
Configuration
.
Binary_Path
.
all
&
"templates/build-script.tmplt"
));
end
Generate
;
end
TASTE
.
Backend
.
Build_Script
;
src/taste-backend-build_script.ads
0 → 100644
View file @
591cc722
with
TASTE
.
AADL_Parser
;
use
TASTE
.
AADL_Parser
;
package
TASTE
.
Backend
.
Build_Script
is
procedure
Generate
(
Model
:
TASTE_Model
);
end
TASTE
.
Backend
.
Build_Script
;
src/taste-backend.ads
0 → 100644
View file @
591cc722
package
TASTE
.
Backend
is
end
TASTE
.
Backend
;
src/taste-parser_version.ads
View file @
591cc722
package
TASTE
.
Parser_Version
is
Parser_Release
:
constant
String
:=
"
fdfcaa9
; Commit Date:
Tue
Jan
2 11:03:26
2018 "
;
"
e27993a
; Commit Date:
Wed
Jan
3 07:07:48
2018 "
;
Ocarina_Version
:
constant
String
:=
"Ocarina 2017.x (Working Copy from rd078c54)"
;
end
TASTE
.
Parser_Version
;
\ No newline at end of file
src/taste-templates.adb
View file @
591cc722
...
...
@@ -30,8 +30,8 @@ package body TASTE.Templates is
Tmpl_Set
:=
Tmpl_Set
&
Assoc
(
Name
,
Value
);
end
Tmpl_Map
;
function
Generate
(
Template_
Fil
e
:
String
)
return
String
is
(
Parse
(
Template_
Fil
e
,
Tmpl_Set
));
function
Generate
(
Template_
Nam
e
:
String
)
return
String
is
(
Parse
(
Template_
Nam
e
,
Tmpl_Set
));
begin
Set_Tag_Separators
(
Start_With
=>
"<"
,
Stop_With
=>
">"
);
...
...
src/taste-templates.ads
View file @
591cc722
...
...
@@ -13,7 +13,7 @@ package TASTE.Templates is
procedure
Tmpl_Map
(
Name
:
String
;
Value
:
Integer
);
procedure
Tmpl_Map
(
Name
:
String
;
Value
:
Tag
);
function
Generate
(
Template_
Fil
e
:
String
)
return
String
;
function
Generate
(
Template_
Nam
e
:
String
)
return
String
;
private
Tmpl_Set
:
Translate_Set
;
...
...
templates/build-script.tmplt
View file @
591cc722
...
...
@@ -71,19 +71,19 @@ else
OUTPUTDIR
=
binary.ada
fi
cd
"
$CWD
"
&&
\
\
assert-builder-ocarina.py
\
\
--fast
\
\
--aadlv2
\
\
--keep-case
\
\
$DEBUG_MODE
\
\
--interfaceView
"
$INTERFACEVIEW
"
\
\
--deploymentView
"
$DEPLOYMENTVIEW
"
\
\
-o
"
$OUTPUTDIR
"
\
\
@@
LIST
@@
cd
"
$CWD
"
&&
\
assert-builder-ocarina.py
\
--fast
\
--aadlv2
\
--keep-case
\
$DEBUG_MODE
\
--interfaceView
"
$INTERFACEVIEW
"
\
--deploymentView
"
$DEPLOYMENTVIEW
"
\
-o
"
$OUTPUTDIR
"
\
@@
TABLE
@@
<Functions>
@@END_
LIST
@@
<CodeCoverage>
\
\
@@END_
TABLE
@@
<CodeCoverage>
\
$ORCHESTRATOR_OPTIONS
if
[
-f
user_init_last.sh
]
...
...
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