Commit b848b3a3 authored by jdelange's avatar jdelange
Browse files

* ocarina/src/backends/ocarina-backends-c_tree-generator.adb

   - Stop to automatically generate comment box around function
     definitions.
 * ocarina/src/backends/ocarina-backends-c_tree-generator.adb
   - Generate a better HTML output

 * ocarina/src/backends/ocarina-backends-po_hi_c-main.adb
   - Include AADL model requirements within comments.



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2712 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 0c6432fc
...@@ -100,7 +100,6 @@ package body Ocarina.Backends.C_Tree.Generator is ...@@ -100,7 +100,6 @@ package body Ocarina.Backends.C_Tree.Generator is
procedure Write_Line (T : Token_Type); procedure Write_Line (T : Token_Type);
procedure Generate_Statement_Delimiter (N : Node_Id); procedure Generate_Statement_Delimiter (N : Node_Id);
procedure Generate_Comment_Box (M : Name_Id);
function Get_File_Name (N : Node_Id) return Name_Id; function Get_File_Name (N : Node_Id) return Name_Id;
-- Generate a C file name from the package node given as parameter -- Generate a C file name from the package node given as parameter
...@@ -975,9 +974,6 @@ package body Ocarina.Backends.C_Tree.Generator is ...@@ -975,9 +974,6 @@ package body Ocarina.Backends.C_Tree.Generator is
P : constant Node_Id := Specification (N); P : constant Node_Id := Specification (N);
M : Node_Id; M : Node_Id;
begin begin
Generate_Comment_Box (Name (Defining_Identifier (P)));
Write_Eol;
Write_Indentation; Write_Indentation;
Generate (P); Generate (P);
...@@ -1313,36 +1309,6 @@ package body Ocarina.Backends.C_Tree.Generator is ...@@ -1313,36 +1309,6 @@ package body Ocarina.Backends.C_Tree.Generator is
end if; end if;
end Generate_Statement_Delimiter; end Generate_Statement_Delimiter;
--------------------------
-- Generate_Comment_Box --
--------------------------
procedure Generate_Comment_Box (M : Name_Id) is
begin
Get_Name_String (M);
Write_Eol;
Write_Str ("/**");
for I in 1 .. Name_Len + 4 loop
Write_Char ('*');
end loop;
Write_Str ("*/");
Write_Eol;
Write_Indentation;
Write_Str ("/* ");
Write_Name (M);
Write_Str (" */ ");
Write_Eol;
Write_Indentation;
Write_Str ("/*");
for I in 1 .. Name_Len + 4 loop
Write_Char ('*');
end loop;
Write_Str ("*/");
Write_Eol;
end Generate_Comment_Box;
------------------------------ ------------------------------
-- Generate_Type_Conversion -- -- Generate_Type_Conversion --
------------------------------ ------------------------------
......
...@@ -135,19 +135,24 @@ package body Ocarina.Backends.PO_HI_C.Main is ...@@ -135,19 +135,24 @@ package body Ocarina.Backends.PO_HI_C.Main is
Period_Variable_Declared := True; Period_Variable_Declared := True;
end if; end if;
N := Make_Doxygen_C_Comment
(Desc => "Store the period time for task " &
Get_Name_String (Name (Identifier (S))),
Has_Header_Spaces => False);
Append_Node_To_List (N, CTN.Statements (Main_Function));
if Get_Thread_Dispatch_Protocol (E) /= Thread_Aperiodic if Get_Thread_Dispatch_Protocol (E) /= Thread_Aperiodic
and then Get_Thread_Dispatch_Protocol (E) /= Thread_Background and then Get_Thread_Dispatch_Protocol (E) /= Thread_Background
then then
N := Map_Time (Get_Thread_Period (E), Get_String_Name ("period")); N := Map_Time (Get_Thread_Period (E), VN (V_Period));
else else
N := Map_Time ((0, Second), Get_String_Name ("period")); N := Map_Time ((0, Second), VN (V_Period));
end if; end if;
Append_Node_To_List Append_Node_To_List
(Make_Variable_Address (Make_Variable_Address
(Make_Defining_Identifier (Make_Defining_Identifier (VN (V_Period))),
(Get_String_Name ("period"))),
Parameters); Parameters);
Append_Node_To_List (N, CTN.Statements (Main_Function)); Append_Node_To_List (N, CTN.Statements (Main_Function));
...@@ -183,14 +188,22 @@ package body Ocarina.Backends.PO_HI_C.Main is ...@@ -183,14 +188,22 @@ package body Ocarina.Backends.PO_HI_C.Main is
case Get_Thread_Dispatch_Protocol (E) is case Get_Thread_Dispatch_Protocol (E) is
when Thread_Periodic => when Thread_Periodic =>
N := Make_Doxygen_C_Comment N := Make_Doxygen_C_Comment
(Brief => "Making Periodic Task", (Brief => "Making Periodic Task " &
Get_Name_String (Name (Identifier (S))),
Desc => "Make a periodic task according to " & Desc => "Make a periodic task according to " &
"AADL model requirements. The first " & "AADL model requirements. The first " &
"parameter is the task identifier defined " & "parameter is the task identifier defined " &
"in deployment.h, the second is the period " & "in deployment.h (" &
Get_Name_String (Map_C_Enumerator_Name (S)) &
") the second is the period " &
"defined in the AADL model. Third is the task " & "defined in the AADL model. Third is the task " &
"priority, fourth is the stack size and last "& "priority (" &
"the subprogram executed by the task", Unsigned_Long_Long'Image (Get_Thread_Priority (E)) &
"), fourth is the stack size ("&
Unsigned_Long_Long'Image
(To_Bytes (Get_Thread_Stack_Size (E))) &
" bytes) and last is the subprogram executed "&
"by the task",
Has_Header_Spaces => False); Has_Header_Spaces => False);
Append_Node_To_List (N, CTN.Statements (Main_Function)); Append_Node_To_List (N, CTN.Statements (Main_Function));
...@@ -476,6 +489,16 @@ package body Ocarina.Backends.PO_HI_C.Main is ...@@ -476,6 +489,16 @@ package body Ocarina.Backends.PO_HI_C.Main is
end loop; end loop;
end if; end if;
N := Make_Doxygen_C_Comment
(Is_Function => True,
Element_Name => "__PO_HI_MAIN_TYPE __PO_HI_MAIN_NAME (void)",
Brief => "Main function executed by the system",
Desc =>
"Full function name and return types are available " &
" in the PolyORB-HI-C runtime header files.",
Has_Header_Spaces => False);
Append_Node_To_List (N, CTN.Declarations (Current_File));
Append_Node_To_List (Main_Function, CTN.Declarations (Current_File)); Append_Node_To_List (Main_Function, CTN.Declarations (Current_File));
-- Call __po_hi_wait_initialization(). With this function, -- Call __po_hi_wait_initialization(). With this function,
-- the main function will wait all other tasks initialization. -- the main function will wait all other tasks initialization.
......
...@@ -332,6 +332,7 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -332,6 +332,7 @@ package body Ocarina.Backends.PO_HI_C is
A : constant Node_Id := A : constant Node_Id :=
AAN.Parent_Component (AAN.Parent_Subcomponent (E)); AAN.Parent_Component (AAN.Parent_Subcomponent (E));
Fd : File_Descriptor; Fd : File_Descriptor;
Rpath : constant String := Get_Runtime_Path ("polyorb-hi-c");
begin begin
Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (A)))); Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (A))));
Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (S)))); Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (S))));
...@@ -353,16 +354,45 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -353,16 +354,45 @@ package body Ocarina.Backends.PO_HI_C is
Write_Line ("GENERATE_MAN = YES"); Write_Line ("GENERATE_MAN = YES");
Write_Line ("GENERATE_RTF = YES"); Write_Line ("GENERATE_RTF = YES");
Write_Line ("CASE_SENSE_NAMES = NO"); Write_Line ("CASE_SENSE_NAMES = NO");
Write_Line ("INPUT = "); Write_Str ("INPUT = . ");
Write_Str (Rpath);
Write_Eol;
Write_Line ("SOURCE_BROWSER = YES");
Write_Line ("OPTIMIZE_OUTPUT_FOR_C = YES");
Write_Line ("GENERATE_TREEVIEW = YES");
Write_Line ("QUIET = YES"); Write_Line ("QUIET = YES");
Write_Line ("HAVE_DOT = YES");
Write_Line ("JAVADOC_AUTOBRIEF = YES"); Write_Line ("JAVADOC_AUTOBRIEF = YES");
Write_Line ("EXTRACT_ALL = YES");
Write_Line ("EXTRACT_PRIVATE = YES"); Write_Line ("EXTRACT_PRIVATE = YES");
Write_Line ("EXTRACT_STATIC = YES"); Write_Line ("EXTRACT_STATIC = YES");
Write_Line ("TYPEDEF_HIDES_STRUCT = YES"); Write_Line ("TYPEDEF_HIDES_STRUCT = YES");
Write_Line ("INLINE_SOURCES = YES"); Write_Line ("INLINE_SOURCES = YES");
Write_Line ("REFERENCED_BY_RELATION = YES"); Write_Line ("REFERENCED_BY_RELATION = YES");
Write_Line ("REFERENCES_RELATION = YES"); Write_Line ("REFERENCES_RELATION = YES");
Write_Line ("SEARCHENGINE = NO"); Write_Line ("SEARCHENGINE = YES");
Write_Line ("SERVER_BASED_SEARCH = NO");
Write_Line ("SEARCH_INCLUDES = YES");
Write_Line ("INCLUDED_BY_GRAPH = YES");
Write_Line ("ENABLE_PREPROCESSING = YES");
Write_Line ("OUTPUT_LANGUAGE = English");
Write_Line ("BRIEF_MEMBER_DESC = YES");
Write_Line ("REPEAT_BRIEF = YES");
Write_Line ("RECURSIVE = YES");
Write_Line ("EXAMPLE_RECURSIVE = NO");
Write_Line ("DIRECTORY_GRAPH = YES");
Write_Line ("CLASS_GRAPH = YES");
Write_Line ("COLLABORATION_GRAPH = YES");
Write_Line ("GROUP_GRAPHS = YES");
Write_Line ("INCLUDE_GRAPH = YES");
Write_Line ("INCLUDED_BY_GRAPH = YES");
Write_Line ("CALL_GRAPH = YES");
Write_Line ("CALLER_GRAPH = YES");
Write_Line ("GRAPHICAL_HIERARCHY = YES");
Write_Line ("DIRECTORY_GRAPH = YES");
Write_Line ("DOT_GRAPH_MAX_NODES = 50");
Write_Line ("MAX_DOT_GRAPH_DEPTH = 0");
Write_Eol; Write_Eol;
Close (Fd); Close (Fd);
......
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