~ubuntu-branches/ubuntu/jaunty/adacontrol/jaunty

« back to all changes in this revision

Viewing changes to src/rules-representation_clauses.adb

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2008-04-27 15:25:59 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080427152559-qrlic533a1x02flu
Tags: 1.8r8-1

* New upstream version.
* debian/adacontrol.gpr: delete; use upstream's project file instead.
* patches/build.patch: patch upstream's project file to change Object_Dir
  and Exec_Dir.
* Build-depend on asis 2007 and gnat-4.3.
* Add support for mips, mipsel and ppc64.
* Build and provide ptree.
* ptree.1: new.
* adactl.1: update; new options and rules are available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
-- ASIS
37
37
with
38
38
  Asis.Clauses,
 
39
  Asis.Declarations,
 
40
  Asis.Definitions,
39
41
  Asis.Elements,
40
 
  Asis.Expressions;
 
42
  Asis.Expressions,
 
43
  Asis.Iterator;
41
44
 
42
45
-- Adalog
43
46
with
 
47
  A4G_Bugs,
44
48
  Binary_Map,
45
49
  Thick_Queries,
46
50
  Utilities;
48
52
-- Adactl
49
53
with
50
54
  Framework.Language,
 
55
  Framework.Queries,
51
56
  Framework.Rules_Manager,
52
 
  Framework.Reports;
 
57
  Framework.Reports,
 
58
  Framework.String_Set;
53
59
pragma Elaborate (Framework.Language);
54
60
 
55
61
package body Rules.Representation_Clauses is
56
62
   use Framework, Ada.Strings.Wide_Unbounded, Utilities;
57
63
 
58
 
   type Clause_Names is (Cl_Attribute, Cl_At, CL_At_Mod, Cl_Enumeration, Cl_Record);
59
 
 
60
 
   package Clause_Flags_Utilities is new Framework.Language.Flag_Utilities (Clause_Names, "CL_");
61
 
   use Clause_Flags_Utilities;
62
 
 
63
 
   -- Clause => Label
 
64
   Storage_Unit : Thick_Queries.Biggest_Int;
 
65
 
 
66
   type Subrules is (Sr_Attribute,
 
67
                     Sr_At,              Sr_At_Mod,            Sr_Enumeration,           Sr_Record,
 
68
                     Sr_Fractional_Size, Sr_Incomplete_Record, Sr_Non_Contiguous_Record);
 
69
 
 
70
   package Subrules_Flags_Utilities is new Framework.Language.Flag_Utilities (Subrules, "SR_");
 
71
   use Subrules_Flags_Utilities;
 
72
 
 
73
   -- Subrule => Label
64
74
   package Context_Map is new Binary_Map (Unbounded_Wide_String, Unbounded_Wide_String);
65
75
   use Context_Map;
66
76
 
67
 
   Usage     : array (Rule_Types) of Context_Map.Map;
68
 
   Rule_Used : Boolean := False;
69
 
   Save_Used : Boolean;
70
 
   Key       : array (Clause_Names range Clause_Names'Succ (Cl_Attribute) .. Clause_Names'Last)
71
 
                  of Unbounded_Wide_String;
 
77
   Usage     : array (Control_Kinds) of Context_Map.Map;
 
78
 
 
79
   type Usage_Flags is array (Subrules) of Boolean;
 
80
   Not_Used  : constant Usage_Flags := (others => False);
 
81
   Rule_Used : Usage_Flags := Not_Used;
 
82
   Save_Used : Usage_Flags;
 
83
   Key       : array (Subrules range Subrules'Succ (Sr_Attribute) .. Subrules'Last) of Unbounded_Wide_String;
72
84
   Key_All   : constant Unbounded_Wide_String := To_Unbounded_Wide_String ("all");
73
85
 
74
86
   ----------------
82
94
         -- attribute
83
95
         return Img;
84
96
      else
85
 
         -- Remove "Cl_"
 
97
         -- Remove "Sr_"
86
98
         return To_Lower (Img (4 .. Img'Last));
87
99
      end if;
88
100
   end Proper_Key;
98
110
      User_Message  ("Control occurrences of representation clauses");
99
111
   end Help;
100
112
 
101
 
   -------------
102
 
   -- Add_Use --
103
 
   -------------
 
113
   -----------------
 
114
   -- Add_Control --
 
115
   -----------------
104
116
 
105
 
   procedure Add_Use (Label     : in Wide_String;
106
 
                      Rule_Type : in Rule_Types) is
 
117
   procedure Add_Control (Ctl_Label : in Wide_String; Ctl_Kind : in Control_Kinds) is
107
118
      use Framework.Language;
108
 
      Clause : Clause_Names;
109
 
      Param  : Unbounded_Wide_String;
 
119
      Subrule : Subrules;
 
120
      Param   : Unbounded_Wide_String;
110
121
 
111
122
   begin
112
123
      if Parameter_Exists then
113
 
         if Is_Present (Usage (Rule_Type), Key_All) then
 
124
         if Is_Present (Usage (Ctl_Kind), Key_All) then
114
125
            Parameter_Error (Rule_Id, "rule already specified for all representation clauses");
115
126
         end if;
116
127
      else
117
 
         if not Is_Empty (Usage (Rule_Type)) then
 
128
         if not Is_Empty (Usage (Ctl_Kind)) then
118
129
            Parameter_Error (Rule_Id, "some representation clauses already specified");
119
130
         end if;
120
 
         Add (Usage (Rule_Type), Key_All, To_Unbounded_Wide_String (Label));
 
131
         Add (Usage (Ctl_Kind), Key_All, To_Unbounded_Wide_String (Ctl_Label));
 
132
         Rule_Used := (others => True);
121
133
      end if;
122
134
 
123
135
      while Parameter_Exists loop
124
 
         Clause := Get_Flag_Parameter (Allow_Any => True);
125
 
         if Clause = Cl_Attribute then
126
 
            Param := To_Unbounded_Wide_String (To_Upper (Get_String_Parameter));
 
136
         Subrule := Get_Flag_Parameter (Allow_Any => True);
 
137
         if Subrule = Sr_Attribute then
 
138
            Param := To_Unbounded_Wide_String (Get_Name_Parameter);
127
139
            if Element (Param, 1) /= ''' then
128
140
               Parameter_Error (Rule_Id, "parameter must be at, at_mod, enumeration, record, or an attribute");
129
141
            end if;
130
142
         else
131
 
            Param := To_Unbounded_Wide_String (Clause_Names'Wide_Image (Clause));
 
143
            Param := To_Unbounded_Wide_String (Subrules'Wide_Image (Subrule));
132
144
         end if;
133
145
 
134
 
         if Is_Present (Usage (Rule_Type), Param) then
 
146
         if Is_Present (Usage (Ctl_Kind), Param) then
135
147
            Parameter_Error (Rule_Id, "clause already given: " & Proper_Key (Param));
136
148
         end if;
137
149
 
138
 
         Add (Usage (Rule_Type), Param, To_Unbounded_Wide_String (Label));
 
150
         Add (Usage (Ctl_Kind), Param, To_Unbounded_Wide_String (Ctl_Label));
 
151
         Rule_Used (Subrule) := True;
139
152
      end loop;
140
153
 
141
 
      Rule_Used := True;
142
 
   end Add_Use;
 
154
   end Add_Control;
143
155
 
144
156
   -------------
145
157
   -- Command --
155
167
            end loop;
156
168
         when Suspend =>
157
169
            Save_Used := Rule_Used;
158
 
            Rule_Used := False;
 
170
            Rule_Used := Not_Used;
159
171
         when Resume =>
160
172
            Rule_Used := Save_Used;
161
173
      end case;
162
174
   end Command;
163
175
 
 
176
   -------------
 
177
   -- Prepare --
 
178
   -------------
 
179
 
 
180
   procedure Prepare is
 
181
      use Asis.Declarations;
 
182
      use Framework.Queries, Thick_Queries;
 
183
   begin
 
184
      if Rule_Used = Not_Used then
 
185
         return;
 
186
      end if;
 
187
 
 
188
      Storage_Unit := Discrete_Static_Expression_Value (Initialization_Expression (System_Value ("STORAGE_UNIT")));
 
189
   end Prepare;
 
190
 
 
191
 
164
192
   --------------------
165
193
   -- Process_Clause --
166
194
   --------------------
167
195
 
168
 
   procedure Process_Clause (Element : in Asis.Representation_Clause) is
169
 
      use Asis, Asis.Clauses, Asis.Elements, Asis.Expressions, Framework.Reports, Thick_Queries;
 
196
   procedure Process_Clause (Rep_Clause : in Asis.Representation_Clause) is
 
197
      use Asis, Asis.Clauses, Asis.Elements, Asis.Expressions, Thick_Queries;
 
198
      use Framework.Reports;
 
199
 
170
200
      Attribute : Unbounded_Wide_String;
171
201
 
172
 
      procedure Check_Usage (Clause : Clause_Names; Message : Wide_String) is
 
202
      procedure Check_Usage (Clause  : Subrules;
 
203
                             Message : Wide_String;
 
204
                             Loc     : Location := Get_Location (Rep_Clause))
 
205
      is
173
206
         Key_Map : Unbounded_Wide_String;
174
207
      begin
175
 
         if Clause = Cl_Attribute then
 
208
         if Clause = Sr_Attribute then
176
209
            Key_Map := Attribute;
177
210
         else
178
211
            Key_Map := Key (Clause);
183
216
            Report (Rule_Id,
184
217
                    To_Wide_String (Fetch (Usage (Check), Key_Map)),
185
218
                    Check,
186
 
                    Get_Location (Element),
 
219
                    Loc,
187
220
                    Message);
188
221
         elsif Is_Present (Usage (Check), Key_All) then
189
222
            Report (Rule_Id,
190
223
                    To_Wide_String (Fetch (Usage (Check), Key_All)),
191
224
                    Check,
192
 
                    Get_Location (Element),
 
225
                    Loc,
193
226
                    Message);
194
227
         elsif Is_Present (Usage (Search), Key_Map) then
195
228
            Report (Rule_Id,
196
229
                    To_Wide_String (Fetch (Usage (Search), Key_Map)),
197
230
                    Search,
198
 
                    Get_Location (Element),
 
231
                    Loc,
199
232
                    Message);
200
233
         elsif Is_Present (Usage (Search), Key_All) then
201
234
            Report (Rule_Id,
202
235
                    To_Wide_String (Fetch (Usage (Search), Key_All)),
203
236
                    Search,
204
 
                    Get_Location (Element),
 
237
                    Loc,
205
238
                    Message);
206
239
         end if;
207
240
 
210
243
            Report (Rule_Id,
211
244
                    To_Wide_String (Fetch (Usage (Count), Key_Map)),
212
245
                    Count,
213
 
                    Get_Location (Element),
 
246
                    Loc,
214
247
                    Message);
215
248
         elsif Is_Present (Usage (Count), Key_All) then
216
249
            Report (Rule_Id,
217
250
                    To_Wide_String (Fetch (Usage (Count), Key_All)),
218
251
                    Count,
219
 
                    Get_Location (Element),
 
252
                    Loc,
220
253
                    Message);
221
254
         end if;
222
 
     end Check_Usage;
 
255
      end Check_Usage;
 
256
 
 
257
      procedure Check_Incomplete (Clause : Asis.Representation_Clause) is
 
258
         use Asis.Declarations;
 
259
         use Framework.String_Set;
 
260
 
 
261
         Components : constant Asis.Component_Clause_List := Component_Clauses (Clause);
 
262
         Compo_Set  : Set;
 
263
 
 
264
         procedure Pre_Procedure (Element : in     Asis.Element;
 
265
                                  Control : in out Asis.Traverse_Control;
 
266
                                  State   : in out Null_State)
 
267
         is
 
268
            pragma Unreferenced (Control, State);
 
269
         begin
 
270
            if Element_Kind (Element) = A_Defining_Name then
 
271
               if not Is_Present (Compo_Set, To_Upper (Defining_Name_Image (Element))) then
 
272
                  Check_Usage (Sr_Incomplete_Record,
 
273
                               "no component clause for "
 
274
                               & Defining_Name_Image (Element)
 
275
                               & " at "
 
276
                               & Image (Get_Location (Element)));
 
277
               end if;
 
278
            end if;
 
279
         end Pre_Procedure;
 
280
 
 
281
         procedure Traverse_Type is new Asis.Iterator.Traverse_Element (Null_State,
 
282
                                                                        Pre_Procedure,
 
283
                                                                        Null_State_Procedure);
 
284
         Control : Asis.Traverse_Control := Continue;
 
285
         State   : Null_State;
 
286
         Decl    : constant Asis.Declaration
 
287
           := Corresponding_Name_Declaration (Representation_Clause_Name (Clause));
 
288
      begin
 
289
         for C in Components'Range loop
 
290
            Add (Compo_Set, To_Upper (A4G_Bugs.Name_Image (Representation_Clause_Name (Components (C)))));
 
291
         end loop;
 
292
 
 
293
         if not Is_Nil (Discriminant_Part (Decl)) then
 
294
            Traverse_Type (Discriminant_Part (Decl), Control, State);
 
295
         end if;
 
296
 
 
297
         Traverse_Type (Type_Declaration_View (Decl), Control, State);
 
298
 
 
299
         Clear (Compo_Set);
 
300
      end Check_Incomplete;
 
301
 
 
302
      procedure Check_Contiguous (Clause : Asis.Representation_Clause) is
 
303
         use Asis.Definitions;
 
304
 
 
305
         type Field_Descriptor is
 
306
            record
 
307
               Low, High : Biggest_Int;
 
308
               Compo_Inx : Asis.List_Index;
 
309
            end record;
 
310
 
 
311
         Components    : constant Asis.Component_Clause_List := Component_Clauses (Clause);
 
312
         Fields        : array (Components'Range) of Field_Descriptor;
 
313
         Used_F        : ASIS_Natural := Fields'First - 1;
 
314
         Size_Expr     : Asis.Expression;
 
315
         Is_Uncheck    : Boolean := False;
 
316
         Starting_Unit : Biggest_Int;
 
317
      begin
 
318
         for C in Components'Range loop
 
319
            declare
 
320
               Pos : constant Extended_Biggest_Natural
 
321
                 := Discrete_Static_Expression_Value (Component_Clause_Position (Components (C)));
 
322
               P   : Biggest_Int;
 
323
               R   : constant Asis.Discrete_Range := Component_Clause_Range (Components (C));
 
324
               L   : constant Extended_Biggest_Natural := Discrete_Static_Expression_Value (Lower_Bound (R));
 
325
               H   : constant Extended_Biggest_Natural := Discrete_Static_Expression_Value (Upper_Bound (R));
 
326
               F   : Field_Descriptor;
 
327
               Ins : Asis.List_Index;
 
328
            begin
 
329
               if Pos = Not_Static or L = Not_Static or H = Not_Static then
 
330
                  Uncheckable (Rule_Id,
 
331
                               False_Negative,
 
332
                               Get_Location (Components (C)),
 
333
                               "unable to evaluate component position for non_contiguous_record subrule");
 
334
                  Is_Uncheck := True;
 
335
               else
 
336
                  P := Pos * Storage_Unit;
 
337
                  F := (Low       => P + L,
 
338
                        High      => P + H,
 
339
                        Compo_Inx => C);
 
340
 
 
341
                  -- Insert F at the right place
 
342
                  -- Since it is highly likely that clauses are given in order, start
 
343
                  -- from the end.
 
344
                  Ins := Fields'First;
 
345
                  for I in reverse List_Index range Fields'First .. Used_F loop
 
346
                     pragma Warnings (Off);
 
347
                     -- Gnat warns that "Fields" may be referenced before it has a value
 
348
                     -- but this cannot happen since the loop is bounded by Used_F
 
349
                     if Fields (I).Low < F.Low then
 
350
                        Ins := I + 1;
 
351
                        exit;
 
352
                     end if;
 
353
                     pragma Warnings (On);
 
354
                     Fields (I + 1) := Fields (I);
 
355
                  end loop;
 
356
                  Fields (Ins) := F;
 
357
                  if Ins /= Fields'First
 
358
                    and then Fields (Ins - 1).High > Fields (Ins).High
 
359
                  then
 
360
                     Fields (Ins).High := Fields (Ins - 1).High;
 
361
                  end if;
 
362
                  Used_F := Used_F + 1;
 
363
               end if;
 
364
            end;
 
365
         end loop;
 
366
         if Is_Uncheck then
 
367
            return;
 
368
         end if;
 
369
 
 
370
         if Fields (Fields'First).Low /= 0 then
 
371
            Check_Usage (Sr_Non_Contiguous_Record,
 
372
                         "gap at 0 range 0.." & Biggest_Int_Img(Fields (Fields'First).Low-1),
 
373
                         Get_Location (Components (Fields(Fields'First).Compo_Inx)));
 
374
         end if;
 
375
         for I in List_Index range Fields'First+1 .. Fields'Last loop
 
376
            if Fields (I - 1).High + 1 < Fields (I).Low then
 
377
               Starting_Unit := (Fields (I - 1).High + 1) / Storage_Unit;
 
378
               Check_Usage (Sr_Non_Contiguous_Record,
 
379
                            "gap before component, at "
 
380
                            & Biggest_Int_Img (Starting_Unit)
 
381
                            & " range "
 
382
                            & Biggest_Int_Img (Fields (I - 1).High + 1 - Starting_Unit * Storage_Unit)
 
383
                            & ".."
 
384
                            & Biggest_Int_Img (Fields (I).Low - 1 - Starting_Unit * Storage_Unit),
 
385
                            Get_Location (Components (Fields (I).Compo_Inx)));
 
386
            end if;
 
387
         end loop;
 
388
 
 
389
         -- Check gap at the end if size clause given
 
390
         Size_Expr := Attribute_Clause_Expression (A_Size_Attribute, Representation_Clause_Name (Clause));
 
391
         if Is_Nil (Size_Expr) then
 
392
            return;
 
393
         end if;
 
394
         declare
 
395
            S : constant Extended_Biggest_Natural := Discrete_Static_Expression_Value (Size_Expr);
 
396
         begin
 
397
            if S = Not_Static then
 
398
               Uncheckable (Rule_Id,
 
399
                            False_Negative,
 
400
                            Get_Location (Clause),
 
401
                            "unable to evaluate size of "
 
402
                            & A4G_Bugs.Name_Image (Representation_Clause_Name (Clause))
 
403
                            & "for non_contiguous_record subrule");
 
404
               return;
 
405
            end if;
 
406
 
 
407
            if Fields (Fields'Last).High /= S - 1 then
 
408
               Starting_Unit := (Fields (Fields'Last).High + 1) / Storage_Unit;
 
409
               Check_Usage (Sr_Non_Contiguous_Record,
 
410
                            "gap at end of record, at "
 
411
                            & Biggest_Int_Img (Starting_Unit)
 
412
                            & " range "
 
413
                            & Biggest_Int_Img (Fields (Fields'Last).High + 1 - Starting_Unit * Storage_Unit)
 
414
                            & ".."
 
415
                            & Biggest_Int_Img (S - 1 - Starting_Unit * Storage_Unit)
 
416
                            & ", size clause line " & Integer_Img (Get_First_Line (Get_Location (Size_Expr))),
 
417
                            Get_Location (Components (Fields (Fields'Last).Compo_Inx)));
 
418
            end if;
 
419
         end;
 
420
      end Check_Contiguous;
223
421
 
224
422
   begin   -- Process_Clause
225
 
      if not Rule_Used then
 
423
      if Rule_Used = Not_Used then
226
424
         return;
227
425
      end if;
228
426
      Rules_Manager.Enter (Rule_Id);
229
427
 
230
 
      case Representation_Clause_Kind (Element) is
 
428
      case Representation_Clause_Kind (Rep_Clause) is
231
429
         when Not_A_Representation_Clause =>
232
430
            Failure ("Not a representation clause in " & Rule_Id);
233
431
 
234
432
         when An_Attribute_Definition_Clause =>
 
433
            if not Rule_Used (Sr_Attribute) and not Rule_Used (Sr_Fractional_Size) then
 
434
               return;
 
435
            end if;
 
436
 
235
437
            Attribute := To_Unbounded_Wide_String (''' & To_Upper (Attribute_Name_Image
236
 
                                                                   (Representation_Clause_Name (Element))));
237
 
            if Expression_Kind (Prefix (Representation_Clause_Name (Element))) = An_Attribute_Reference then
 
438
                                                                   (Representation_Clause_Name (Rep_Clause))));
 
439
            if Expression_Kind (Prefix (Representation_Clause_Name (Rep_Clause))) = An_Attribute_Reference then
238
440
               -- This happens only in for T'Class'Read and similar
239
441
 
240
442
               -- ASIS BUG:
247
449
               -- Note that we call Asis.Elements.Attribute_Kind, not A4G_Bugs.Attribute_Kind
248
450
               -- because the version in A4G_Bugs does not work due to the same ASIS bug, but the
249
451
               -- regular version seems to work in this case. Sigh.
250
 
               case Attribute_Kind (Representation_Clause_Name (Element)) is --## RULE LINE OFF Use_A4G_Bugs
 
452
               case Attribute_Kind (Representation_Clause_Name (Rep_Clause)) is --## RULE LINE OFF Use_A4G_Bugs
251
453
                  when A_Read_Attribute =>
252
454
                     Attribute := To_Unbounded_Wide_String ("'CLASS'READ");
253
455
                  when A_Write_Attribute =>
257
459
                  when An_Output_Attribute =>
258
460
                     Attribute := To_Unbounded_Wide_String ("'CLASS'OUTPUT");
259
461
                  when others =>
260
 
                     Failure ("Unexpected double attribute in " & Rule_Id, Element);
 
462
                     Failure ("Unexpected double attribute in " & Rule_Id, Rep_Clause);
261
463
               end case;
262
464
            end if;
263
465
 
264
 
            Check_Usage (Cl_Attribute, "use of representation clause for " & To_Wide_String (Attribute));
 
466
            Check_Usage (Sr_Attribute, "use of representation clause for " & To_Wide_String (Attribute));
 
467
 
 
468
            if Attribute = "'SIZE" and then Rule_Used (Sr_Fractional_Size) then
 
469
               declare
 
470
                  Value : constant Extended_Biggest_Natural
 
471
                    := Discrete_Static_Expression_Value (Representation_Clause_Expression (Rep_Clause));
 
472
               begin
 
473
                  if Value = Not_Static then
 
474
                     Uncheckable (Rule_Id,
 
475
                                  False_Negative,
 
476
                                  Get_Location (Representation_Clause_Expression (Rep_Clause)),
 
477
                                  "unable to evaluate size for fractional_size subrule");
 
478
                  elsif Value rem Storage_Unit /= 0 then
 
479
                     Check_Usage (Sr_Fractional_Size, "size clause not multiple of Storage_Unit");
 
480
                  end if;
 
481
               end;
 
482
            end if;
265
483
 
266
484
         when An_Enumeration_Representation_Clause =>
267
 
            Check_Usage (Cl_Enumeration, "use of enumeration representation clause");
 
485
            Check_Usage (Sr_Enumeration, "use of enumeration representation clause");
268
486
 
269
487
         when A_Record_Representation_Clause =>
270
 
            Check_Usage (Cl_Record, "use of record representation clause");
271
 
 
272
 
            if not Is_Nil (Mod_Clause_Expression (Element)) then
273
 
               Check_Usage (CL_At_Mod, "use of Ada 83 alignment clause");
 
488
            Check_Usage (Sr_Record, "use of record representation clause");
 
489
 
 
490
            if Rule_Used (Sr_At_Mod) and then not Is_Nil (Mod_Clause_Expression (Rep_Clause)) then
 
491
               Check_Usage (Sr_At_Mod, "use of Ada 83 alignment clause");
 
492
            end if;
 
493
 
 
494
            if Rule_Used (Sr_Incomplete_Record) then
 
495
               Check_Incomplete (Rep_Clause);
 
496
            end if;
 
497
 
 
498
            if Rule_Used (Sr_Non_Contiguous_Record) then
 
499
               Check_Contiguous (Rep_Clause);
274
500
            end if;
275
501
 
276
502
         when An_At_Clause =>
277
 
            Check_Usage (Cl_At, "use of Ada 83 address clause");
 
503
            Check_Usage (Sr_At, "use of Ada 83 address clause");
278
504
      end case;
279
505
   end Process_Clause;
280
506
 
281
507
begin
282
 
   for K in Clause_Names range Clause_Names'Succ (Cl_Attribute) .. Clause_Names'Last loop
283
 
      Key (K) := To_Unbounded_Wide_String (Clause_Names'Wide_Image (K));
 
508
   for K in Subrules range Subrules'Succ (Sr_Attribute) .. Subrules'Last loop
 
509
      Key (K) := To_Unbounded_Wide_String (Subrules'Wide_Image (K));
284
510
   end loop;
285
511
 
286
 
   Framework.Rules_Manager.Register_Semantic (Rule_Id,
287
 
                                              Help    => Help'Access,
288
 
                                              Add_Use => Add_Use'Access,
289
 
                                              Command => Command'Access);
 
512
   Framework.Rules_Manager.Register (Rule_Id,
 
513
                                     Rules_Manager.Semantic,
 
514
                                     Help_CB        => Help'Access,
 
515
                                     Add_Control_CB => Add_Control'Access,
 
516
                                     Command_CB     => Command'Access,
 
517
                                     Prepare_CB     => Prepare'Access);
290
518
end Rules.Representation_Clauses;