Commit 5cc18f34 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add translation table for the languages

There is little consistency between the Language property in Ocarina and
other parts such as the flags in the orchestrator. This is a workaround,
that could also be done in a template file, for the following issues;
- Ocarina refers to Language_ADA_95 while TASTE supports Ada 2012
- The casing in the orchestrator is mixing uppercase (--subSIMULINK)
and mixed case (--subMicroPython, --subQGenC).
parent 9cc8a70e
......@@ -15,7 +15,7 @@ package body TASTE.Backend.Build_Script is
declare
Template_Data : constant Translate_Table :=
(1 => Assoc ("Function_Name", Each.Name),
2 => Assoc ("Language", Each.Language'Img));
2 => Assoc ("Language", Language_Spelling (Each)));
Element_Code : constant String :=
Parse (Prefix & "build-script-gencode.tmplt", Template_Data);
Element_Zip : constant String :=
......
with Ocarina.Backends.Properties,
TASTE.Interface_View;
package TASTE.Backend is
use Ocarina.Backends.Properties,
Interface_View;
function Language_Spelling (Func : Taste_Terminal_Function) return String is
(case Func.Language is
when Language_Ada_95 => "Ada",
when Language_ASN1 => "ASN1",
when Language_C => "C",
when Language_Esterel => "Esterel", -- Not supported
when Language_Device => "C",
when Language_Gui => "GUI",
when Language_Lua => "Lua", -- Not supported
when Language_Lustre => "SCADE", -- Not supported
when Language_Rhapsody => "CPP",
when Language_SDL_RTDS => "RTDS", -- Pragmadev Studio
when Language_CPP => "CPP",
when Language_SDL_OpenGEODE => "SDL",
when Language_RTSJ => "RTSJ", -- Not supported
when Language_Scade => "SCADE", -- Not supported
when Language_SDL => "SDL",
when Language_Simulink => "SIMULINK",
when Language_QGenC => "QGenC",
when Language_QGenAda => "QGenAda",
when Language_System_C => "System_C", -- Not supported
when Language_VDM => "VDM", -- Partial support
when Language_VHDL => "VHDL",
when Language_MicroPython => "MicroPython",
when Language_None => "None");
end TASTE.Backend;
package TASTE.Parser_Version is
Parser_Release : constant String :=
"c87b811 ; Commit Date: Wed Jan 3 20:39:51 2018 ";
"9cc8a70 ; Commit Date: Wed Jan 3 21:04:13 2018 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from rd078c54)";
end TASTE.Parser_Version;
\ No newline at end of file
@@IF@@ @_Language_@ /= "LANGUAGE_GUI"
--sub@_REPLACE(Sdl/Ada):REPLACE(Ada_95/Ada):CAPITALIZE:SLICE(10 .. 0):Language_@ @_Function_Name_@ \
@@IF@@ @_Language_@ /= GUI
--sub@_REPLACE(SDL/Ada):REPLACE(VDM/C):Language_@ @_Function_Name_@ \
@@END_IF@@
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment