Commit d66af285 authored by jdelange's avatar jdelange

* ocarina/src/backends/ocarina-backends-properties.adb

   ocarina/src/backends/ocarina-backends-properties.ads
   - Support for Subprogram_LUA subprogram kind
   - Add Language_LUA_Name and Language_LUA

 * ocarina/src/backends/ocarina-backends-po_hi_c-runtime.ads
   - Introduce RH_PO_HI_Lua, RE_LUA_Load, RE_LUA_Load_File
     and RE_LUA_Load_File_With_Function entities

 * ocarina/src/backends/ocarina-backends-c_common-mapping.adb
   - Map LUA subprograms

 * ocarina/resources/AADLv2/aadl_project.aadl
   - Add LUA language in the potential supported languages



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@3660 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent e4f99f64
......@@ -98,6 +98,7 @@ property set AADL_Project is
CPP, -- C++
Esterel,
GUI,
LUA,
Lustre,
Lustre5, -- alias for Lustre
Lustre6, -- alias for Lustre
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2011, European Space Agency (ESA). --
-- Copyright (C) 2008-2012, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -2146,6 +2146,36 @@ package body Ocarina.Backends.C_Common.Mapping is
return Make_Function_Implementation
(Spec, Declarations, Statements);
when Subprogram_LUA =>
if Get_Source_Text (S)'Size = 0 then
Display_Located_Error
(AIN.Loc (S),
"This subprogram must have the property Source_Text",
Fatal => True);
end if;
Append_Node_To_List
(Make_Literal
(C_Values.New_Pointed_Char_Value
(Get_Source_Text (S)(1))),
Call_Profile);
if Get_Source_Name (S) /= No_Name then
Append_Node_To_List
(Make_Literal
(C_Values.New_Pointed_Char_Value
(Get_Source_Name (S))),
Call_Profile);
end if;
Append_Node_To_List
(CTU.Make_Call_Profile
(RE (RE_LUA_Load), Call_Profile),
Statements);
return Make_Function_Implementation
(Spec, Declarations, Statements);
when Subprogram_Opaque_C =>
-- Create function to lock the data.
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2011, European Space Agency (ESA). --
-- Copyright (C) 2008-2012, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -40,6 +40,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RH_PO_HI_Task, -- po_hi_task header
RH_PO_HI_Time, -- po_hi_time header
RH_PO_HI_Common, -- po_hi_common header
RH_PO_HI_Lua, -- po_hi_lua
RH_PO_HI_Main, -- po_hi_main header
RH_PO_HI_Messages, -- po_hi_messages header
RH_PO_HI_Protected, -- po_hi_protected header
......@@ -71,6 +72,9 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Wait_For_Next_Period, -- __po_hi_task_wait_for_next_period
RE_Initialize, -- __po_hi_initialize
RE_Initialize_Early, -- __po_hi_initialize_early
RE_LUA_Load, -- __po_hi_lua_load
RE_LUA_Load_File, -- __po_hi_lua_load_file
RE_LUA_Load_File_With_Function, -- __po_hi_lua_load_file_with_function
RE_Wait_Initialization, -- __po_hi_wait_initialization
RE_Marshall_Bool, -- __po_hi_marshall_bool
RE_Unmarshall_Bool, -- __po_hi_unmarshall_bool
......@@ -294,6 +298,9 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Unmarshall_Float64 => RH_PO_HI_Marshallers,
RE_Marshall_Port => RH_PO_HI_Marshallers,
RE_Unmarshall_Port => RH_PO_HI_Marshallers,
RE_LUA_Load => RH_PO_HI_Lua,
RE_LUA_Load_File => RH_PO_HI_Lua,
RE_LUA_Load_File_With_Function => RH_PO_HI_Lua,
RE_Marshall_Request => RH_Marshallers,
RE_Unmarshall_Request => RH_Marshallers,
RE_Marshall_Asn1_Request => RH_Marshallers,
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2011, European Space Agency (ESA). --
-- Copyright (C) 2008-2012, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -265,6 +265,7 @@ package body Ocarina.Backends.Properties is
Language_Device_Name : Name_Id;
Language_Esterel_Name : Name_Id;
Language_GUI_Name : Name_Id;
Language_LUA_Name : Name_Id;
Language_Lustre_Name : Name_Id;
Language_Lustre5_Name : Name_Id;
Language_Lustre6_Name : Name_Id;
......@@ -1391,6 +1392,9 @@ package body Ocarina.Backends.Properties is
elsif Source_L = Language_GUI_Name then
return Language_GUI;
elsif Source_L = Language_LUA_Name then
return Language_LUA;
else
Display_Located_Error
(AIN.Loc (E),
......@@ -1475,6 +1479,9 @@ package body Ocarina.Backends.Properties is
when Language_Esterel =>
return Subprogram_Esterel;
when Language_Lua =>
return Subprogram_Lua;
when Language_ASN1 =>
-- A subprogram having ASN1 as implementation
-- language is not supported.
......@@ -3153,6 +3160,7 @@ package body Ocarina.Backends.Properties is
Language_Lustre5_Name := Get_String_Name ("lustre5");
Language_Lustre6_Name := Get_String_Name ("lustre6");
Language_GUI_Name := Get_String_Name ("gui");
Language_LUA_Name := Get_String_Name ("lua");
Language_Rhapsody_Name := Get_String_Name ("rhapsody");
Language_SCADE6_Name := Get_String_Name ("scade6");
Language_SDL_Name := Get_String_Name ("sdl");
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2011, European Space Agency (ESA). --
-- Copyright (C) 2008-2012, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -66,6 +66,7 @@ package Ocarina.Backends.Properties is
Language_Esterel,
Language_Device,
Language_Gui,
Language_Lua,
Language_Lustre,
Language_Rhapsody,
Language_SDL_RTDS,
......@@ -515,6 +516,7 @@ package Ocarina.Backends.Properties is
Subprogram_Scade,
Subprogram_Lustre,
Subprogram_Esterel,
Subprogram_Lua,
Subprogram_Pure_Call_Sequence,
Subprogram_Hybrid_Ada_95);
......
Markdown is supported
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