@@ -23,6 +23,8 @@ with Libadalang.Common;
2323with VSS.Strings.Conversions ;
2424
2525with GNATdoc.Comments.Extractor ;
26+ with GNATdoc.Comments.Undocumented_Checker ;
27+ with GNATdoc.Configuration ;
2628with GNATdoc.Entities ;
2729with GNATdoc.Options ;
2830
@@ -156,6 +158,24 @@ package body GNATdoc.Frontend is
156158 function Signature (Name : Defining_Name'Class) return Virtual_String;
157159 -- Computes unique signature of the given entity.
158160
161+ procedure Check_Undocumented
162+ (Entity : not null GNATdoc.Entities.Entity_Information_Access);
163+ -- Check whether entiry and all components of the entity are documented.
164+ -- Generate warnings when they are enabled.
165+
166+ -- ----------------------
167+ -- Check_Undocumented --
168+ -- ----------------------
169+
170+ procedure Check_Undocumented
171+ (Entity : not null GNATdoc.Entities.Entity_Information_Access) is
172+ begin
173+ if GNATdoc.Configuration.Provider.Warnings_Enabled then
174+ GNATdoc.Comments.Undocumented_Checker.Check_Undocumented
175+ (Entity.Location, Entity.Name, Entity.Documentation);
176+ end if ;
177+ end Check_Undocumented ;
178+
159179 -- ------------
160180 -- Location --
161181 -- ------------
@@ -194,6 +214,7 @@ package body GNATdoc.Frontend is
194214
195215 begin
196216 Enclosing.Access_Types.Insert (Entity);
217+ Check_Undocumented (Entity);
197218 end Process_Access_Type_Def ;
198219
199220 -- --------------------------
@@ -216,6 +237,7 @@ package body GNATdoc.Frontend is
216237
217238 begin
218239 Enclosing.Array_Types.Insert (Entity);
240+ Check_Undocumented (Entity);
219241 end Process_Array_Type_Def ;
220242
221243 -- --------------------------
@@ -243,6 +265,8 @@ package body GNATdoc.Frontend is
243265 if Global /= null and GNATdoc.Entities.Globals'Access /= Enclosing then
244266 Global.Subprograms.Insert (Entity);
245267 end if ;
268+
269+ Check_Undocumented (Entity);
246270 end Process_Base_Subp_Body ;
247271
248272 -- --------------------
@@ -548,6 +572,8 @@ package body GNATdoc.Frontend is
548572 if Global /= null and GNATdoc.Entities.Globals'Access /= Enclosing then
549573 Global.Subprograms.Insert (Entity);
550574 end if ;
575+
576+ Check_Undocumented (Entity);
551577 end Process_Classic_Subp_Decl ;
552578
553579 -- ----------------------------
@@ -673,6 +699,8 @@ package body GNATdoc.Frontend is
673699 else
674700 Enclosing.Simple_Types.Insert (Entity);
675701 end if ;
702+
703+ Check_Undocumented (Entity);
676704 end Process_Derived_Type_Def ;
677705
678706 -- ----------------------
@@ -695,6 +723,7 @@ package body GNATdoc.Frontend is
695723
696724 begin
697725 Enclosing.Entries.Insert (Entity);
726+ Check_Undocumented (Entity);
698727 end Process_Entry_Body ;
699728
700729 -- ----------------------
@@ -717,6 +746,7 @@ package body GNATdoc.Frontend is
717746
718747 begin
719748 Enclosing.Entries.Insert (Entity);
749+ Check_Undocumented (Entity);
720750 end Process_Entry_Decl ;
721751
722752 -- --------------------------
@@ -743,6 +773,7 @@ package body GNATdoc.Frontend is
743773
744774 begin
745775 Enclosing.Exceptions.Insert (Entity);
776+ Check_Undocumented (Entity);
746777 end ;
747778 end loop ;
748779 end Process_Exception_Decl ;
@@ -775,6 +806,8 @@ package body GNATdoc.Frontend is
775806 if Global /= null and GNATdoc.Entities.Globals'Access /= Enclosing then
776807 Global.Generic_Instantiations.Insert (Entity);
777808 end if ;
809+
810+ Check_Undocumented (Entity);
778811 end Process_Generic_Instantiation ;
779812
780813 -- --------------------------------
@@ -808,6 +841,8 @@ package body GNATdoc.Frontend is
808841 GNATdoc.Entities.Globals.Packages.Insert (Entity);
809842 end if ;
810843
844+ Check_Undocumented (Entity);
845+
811846 Process_Children (Node.F_Package_Decl.F_Public_Part, Entity);
812847
813848 if GNATdoc.Options.Frontend_Options.Generate_Private then
@@ -835,6 +870,7 @@ package body GNATdoc.Frontend is
835870
836871 begin
837872 Enclosing.Interface_Types.Insert (Entity);
873+ Check_Undocumented (Entity);
838874 end Process_Interface_Type_Def ;
839875
840876 -- -----------------------
@@ -861,6 +897,7 @@ package body GNATdoc.Frontend is
861897
862898 begin
863899 Enclosing.Constants.Insert (Entity);
900+ Check_Undocumented (Entity);
864901 end ;
865902 end loop ;
866903 end Process_Number_Decl ;
@@ -894,6 +931,8 @@ package body GNATdoc.Frontend is
894931 else
895932 Enclosing.Variables.Insert (Entity);
896933 end if ;
934+
935+ Check_Undocumented (Entity);
897936 end ;
898937 end loop ;
899938 end Process_Object_Decl ;
@@ -929,6 +968,8 @@ package body GNATdoc.Frontend is
929968 GNATdoc.Entities.Globals.Packages.Insert (Entity);
930969 end if ;
931970
971+ Check_Undocumented (Entity);
972+
932973 Process_Children (Node.F_Public_Part, Entity);
933974
934975 if GNATdoc.Options.Frontend_Options.Generate_Private then
@@ -972,6 +1013,8 @@ package body GNATdoc.Frontend is
9721013 GNATdoc.Entities.Globals.Packages.Insert (Entity);
9731014 end if ;
9741015
1016+ Check_Undocumented (Entity);
1017+
9751018 Process_Children (Node.F_Decls, Entity);
9761019 end Process_Package_Body ;
9771020
@@ -1001,6 +1044,8 @@ package body GNATdoc.Frontend is
10011044 if Global /= null and GNATdoc.Entities.Globals'Access /= Enclosing then
10021045 Global.Package_Renamings.Insert (Entity);
10031046 end if ;
1047+
1048+ Check_Undocumented (Entity);
10041049 end Process_Package_Renaming_Decl ;
10051050
10061051 -- ----------------------------
@@ -1028,6 +1073,8 @@ package body GNATdoc.Frontend is
10281073 else
10291074 Enclosing.Simple_Types.Insert (Entity);
10301075 end if ;
1076+
1077+ Check_Undocumented (Entity);
10311078 end Process_Private_Type_Def ;
10321079
10331080 -- --------------------------
@@ -1059,6 +1106,8 @@ package body GNATdoc.Frontend is
10591106 GNATdoc.Entities.Globals.Packages.Insert (Entity);
10601107 end if ;
10611108
1109+ Check_Undocumented (Entity);
1110+
10621111 Process_Children (Node.F_Decls, Entity);
10631112 end Process_Protected_Body ;
10641113
@@ -1094,6 +1143,8 @@ package body GNATdoc.Frontend is
10941143 GNATdoc.Entities.Globals.Protected_Types.Insert (Entity);
10951144 end if ;
10961145
1146+ Check_Undocumented (Entity);
1147+
10971148 Process_Children (Definition.F_Public_Part, Entity);
10981149
10991150 if GNATdoc.Options.Frontend_Options.Generate_Private then
@@ -1121,6 +1172,7 @@ package body GNATdoc.Frontend is
11211172
11221173 begin
11231174 Enclosing.Record_Types.Insert (Entity);
1175+ Check_Undocumented (Entity);
11241176 end Process_Record_Type_Def ;
11251177
11261178 -- ---------------------------
@@ -1143,6 +1195,7 @@ package body GNATdoc.Frontend is
11431195
11441196 begin
11451197 Enclosing.Simple_Types.Insert (Entity);
1198+ Check_Undocumented (Entity);
11461199 end Process_Simple_Type_Def ;
11471200
11481201 -- ------------------------
@@ -1165,6 +1218,7 @@ package body GNATdoc.Frontend is
11651218
11661219 begin
11671220 Enclosing.Subtypes.Insert (Entity);
1221+ Check_Undocumented (Entity);
11681222 end Process_Subtype_Decl ;
11691223
11701224 -- ---------------------
@@ -1199,6 +1253,8 @@ package body GNATdoc.Frontend is
11991253 GNATdoc.Entities.Globals.Task_Types.Insert (Entity);
12001254 end if ;
12011255
1256+ Check_Undocumented (Entity);
1257+
12021258 if not Decl.F_Definition.Is_Null then
12031259 Process_Children (Decl.F_Definition.F_Public_Part, Entity);
12041260
0 commit comments