ocarina-analyzer-messages.adb 23.4 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--            O C A R I N A . A N A L Y Z E R . M E S S A G E S             --
--                                                                          --
--                                 B o d y                                  --
--                                                                          --
9
--          Copyright (C) 2004-2011, European Space Agency (ESA).           --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--                                                                          --
-- Ocarina  is free software;  you  can  redistribute  it and/or  modify    --
-- it under terms of the GNU General Public License as published by the     --
-- Free Software Foundation; either version 2, or (at your option) any      --
-- later version. Ocarina is distributed  in  the  hope  that it will be    --
-- useful, but WITHOUT ANY WARRANTY;  without even the implied warranty of  --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received  a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING.   --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA.                                       --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable to be   --
-- covered  by the  GNU  General  Public  License. This exception does not  --
-- however invalidate  any other reasons why the executable file might be   --
-- covered by the GNU Public License.                                       --
--                                                                          --
--                 Ocarina is maintained by the Ocarina team                --
--                       (ocarina-users@listes.enst.fr)                     --
--                                                                          --
------------------------------------------------------------------------------

with Namet;
with Output;

with Ocarina.Me_AADL.AADL_Tree.Debug;
with Ocarina.Me_AADL.AADL_Tree.Entities.Properties;

package body Ocarina.Analyzer.Messages is

   use Ocarina.Me_AADL.AADL_Tree.Entities;
   use Ocarina.Me_AADL.AADL_Tree.Entities.Properties;

   procedure Display_Location_And_Node_Kind
     (Loc  : Location;
      Kind : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind);

   function Image
     (Category : Ocarina.Me_AADL.Component_Category)
     return String;
   --  Return component category image

   -----------------------
   -- Display_Node_Link --
   -----------------------

   procedure Display_Node_Link (Node1 : Node_Id; Node2 : Node_Id) is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

   begin
      if D_Analyzer then
         Set_Standard_Error;
         Write_Str ("ANL: ");

         if Present (Node1) then
            Write_Str (Image (Loc (Node1)));
         else
            Write_Str ("no loc");
         end if;

         Write_Str (" -> ");

         if Present (Node2) then
            Write_Line (Image (Loc (Node2)));
         else
            Write_Line ("no loc");
         end if;

         Set_Standard_Output;
      end if;
   end Display_Node_Link;

   ----------------------------
   -- Display_Analyzer_Error --
   ----------------------------

   procedure Display_Analyzer_Error
     (Node1    : Node_Id;
      Message1 : String;
      Node2    : Node_Id  := No_Node;
      Message2 : String   := "";
      Message0 : String   := "";
      Loc      : Location := No_Location)
   is
      use Ocarina.Me_AADL.AADL_Tree.Debug;
      use Namet;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Output;
      use Ocarina.ME_AADL;

   begin
      Set_Standard_Error;

      if Loc /= No_Location then
         Write_Str (Image (Loc) & ": ");
      else
109
110
111
112
         if Present (Node1) then
            Write_Str
              (Image (Ocarina.Me_AADL.AADL_Tree.Nodes.Loc (Node1)) & ": ");
         end if;
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
      end if;

      if Message0 /= "" then
         Write_Str (" (" & Message0 & ") ");
      end if;

      if Present (Node1) then
         if Get_Entity_Category (Node1) /= EC_Undefined then
            Write_Name (Get_Name_Of_Entity (Node1, Get_Display_Name => True));
         elsif Kind (Node1) = K_Entity_Reference then
            Write_Name (Get_Name_Of_Entity_Reference
                          (Node1, Get_Display_Name => True));
         elsif Kind (Node1) = K_Identifier then
            Write_Name (Display_Name (Node1));
         end if;

         Write_Str (" (" & Image (Kind (Node1)) & ") ");
      end if;

      Write_Str (Message1);

      if Present (Node2) then
         if Get_Entity_Category (Node2) /= EC_Undefined then
            Write_Name (Get_Name_Of_Entity (Node2,
                                            Get_Display_Name => True));
         elsif Kind (Node2) = K_Entity_Reference then
            Write_Name (Get_Name_Of_Entity_Reference
                        (Node2, Get_Display_Name => True));
         end if;

         Write_Str (" (" & Image (Kind (Node2)) & ") ");
      end if;

      Write_Line (Message2);
      Set_Standard_Output;
   end Display_Analyzer_Error;

   ----------------------------------
   -- Display_Conflict_Declaration --
   ----------------------------------

   procedure Display_Conflict_Declaration
     (Loc1 : Location;
      Kind : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind;
      Name : Name_Id;
      Loc2 : Location)
   is
      use Namet;
      use Output;

   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc1, Kind);
      Write_Str (" '");
      Write_Name (Name);
      Write_Str ("' conflicts with declaration at ");
      Write_Line (Image (Loc2));

      Set_Standard_Output;
   end Display_Conflict_Declaration;

   ----------------------------------
   -- Display_Conflict_Declaration --
   ----------------------------------

   procedure Display_Conflict_Declaration
     (Ident1 : Node_Id;
      Ident2 : Node_Id)
   is
      use Namet;
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc (Ident1),
                                      Kind (Corresponding_Entity (Ident1)));
      Write_Str (" '");
      Write_Name (Display_Name (Ident1));
      Write_Str ("' conflicts with declaration ");

      Write_Str (Ocarina.Me_AADL.AADL_Tree.Debug.Image
                   (Kind (Corresponding_Entity (Ident2))));
      Write_Str (" '");
      Write_Name (Display_Name (Ident2));
      Write_Str ("' at ");

      Write_Line (Image (Loc (Ident2)));

      Set_Standard_Output;
   end Display_Conflict_Declaration;

   ------------------------------------
   -- Display_Location_And_Node_Kind --
   ------------------------------------

   procedure Display_Location_And_Node_Kind
     (Loc  : Location;
      Kind : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Debug;
   begin
      Write_Str (Image (Loc));
      Write_Str (": ");
      Write_Str (Ocarina.Me_AADL.AADL_Tree.Debug.Image (Kind));
   end Display_Location_And_Node_Kind;

   ----------------------------
   -- Display_Undefined_Item --
   ----------------------------

   procedure Display_Undefined_Item
     (Loc  : Location;
      Kind : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind;
      Name : Name_Id)
   is
      use Namet;
      use Output;

   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc, Kind);
      Write_Str (" '");
      Write_Name (Name);
      Write_Line ("' is undefined or not visible");

      Set_Standard_Output;
   end Display_Undefined_Item;

   ----------------------------
   -- Display_Undefined_Item --
   ----------------------------
   procedure Display_Undefined_Item
     (Kind : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind;
      Item : Node_Id)
   is
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Output;
      use Namet;

   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc (Item), Kind);
      Write_Str (" '");
      Write_Str (Get_Name_String (Display_Name (Item)));
      Write_Line ("' is undefined or not visible");

      Set_Standard_Output;
   end Display_Undefined_Item;

   -------------------------------------------
   -- Display_Unexpected_Component_Category --
   -------------------------------------------

   procedure Display_Unexpected_Component_Category
     (Expected_Cat : Ocarina.Me_AADL.Component_Category;
      Found_Cat    : Ocarina.Me_AADL.Component_Category;
      Item         : Node_Id;
      Loc          : Location)
   is
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Output;
      use Namet;

   begin
      Set_Standard_Error;

      Write_Str (Image (Ocarina.Me_AADL.AADL_Tree.Nodes.Loc (Item)));
      Write_Str (": expected component category ");
      Write_Str (Image (Expected_Cat));
      Write_Str (", found ");
      Write_Str (Image (Found_Cat));
      Write_Str (" '");
      Write_Str (Get_Name_String (Display_Name (Item)));
      Write_Str ("' defined at ");
      Write_Line (Image (Loc));

      Set_Standard_Output;
   end Display_Unexpected_Component_Category;

   -----------------------------
   -- Display_Unexpected_Type --
   -----------------------------

   procedure Display_Unexpected_Type
     (Expected_Type : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind;
      Found_Type    : Ocarina.Me_AADL.AADL_Tree.Nodes.Node_Kind;
      Item          : Node_Id;
      Loc           : Location)
   is
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Output;
      use Namet;

   begin
      Set_Standard_Error;

      Write_Str (Image (Ocarina.Me_AADL.AADL_Tree.Nodes.Loc (Item)));
      Write_Str (": expected type ");
      Write_Str (Ocarina.Me_AADL.AADL_Tree.Debug.Image (Expected_Type));
      Write_Str (", found type ");
      Write_Str (Ocarina.Me_AADL.AADL_Tree.Debug.Image (Found_Type));
      Write_Str (" '");
      Write_Str (Get_Name_String (Display_Name (Item)));
      Write_Str ("' defined at ");
      Write_Line (Image (Loc));

      Set_Standard_Output;
   end Display_Unexpected_Type;

   -----------
   -- Image --
   -----------

   function Image
     (Category : Ocarina.ME_AADL.Component_Category)
     return String
   is
      use Ocarina.ME_AADL;
   begin
      case Category is
         when CC_Abstract          => return "Abstract";
         when CC_Data              => return "Data";
         when CC_Subprogram        => return "Subprogram";
         when CC_Subprogram_Group  => return "Subprogram Group";
         when CC_Thread            => return "Thread";
         when CC_Thread_Group      => return "Thread Group";
         when CC_Process           => return "Process";
         when CC_Memory            => return "Memory";
         when CC_Processor         => return "Processor";
         when CC_Virtual_Processor => return "Virtual Processor";
         when CC_Virtual_Bus       => return "Virtual Bus";
         when CC_Bus               => return "Bus";
         when CC_Device            => return "Device";
         when CC_System            => return "System";
         when CC_Unknown           => return "UNKNOWN";
      end case;
   end Image;

   -------------------
   -- Debug_Message --
   -------------------

   procedure Debug_Message (Location : String; Message : String) is
      use Output;
   begin
      if D_Analyzer then
         Set_Standard_Error;

         Write_Str ("ANL: ");
         Write_Str (Location & ": ");
         Write_Line (Message);

         Set_Standard_Output;
      end if;
   end Debug_Message;

   ------------------------------
   -- Display_Cyclic_Extension --
   ------------------------------

   procedure Display_Cyclic_Extension (Cycling_Node : Node_Id) is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Present (Cycling_Node));
   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc (Cycling_Node), Kind (Cycling_Node));
      Write_Line (" creates a circular extension ");

      Set_Standard_Output;
   end Display_Cyclic_Extension;

   ------------------------------
   -- Display_Cyclic_Inversion --
   ------------------------------

   procedure Display_Cyclic_Inversion (Cycling_Node : Node_Id) is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Present (Cycling_Node));
   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc (Cycling_Node), Kind (Cycling_Node));
      Write_Line (" creates a cycle in port group inversions");

      Set_Standard_Output;
   end Display_Cyclic_Inversion;

   ----------------------------------
   -- Display_Cyclic_Subcomponents --
   ----------------------------------

   procedure Display_Cyclic_Subcomponents (Cycling_Node : Node_Id) is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Present (Cycling_Node));
   begin
      Set_Standard_Error;

      Display_Location_And_Node_Kind (Loc (Cycling_Node), Kind (Cycling_Node));
      Write_Line (" creates a cycle in subcomponent declarations");

      Set_Standard_Output;
   end Display_Cyclic_Subcomponents;

   ---------------------------------------
   -- Display_Conflicting_Initial_Modes --
   ---------------------------------------

   procedure Display_Conflicting_Initial_Modes
     (Initial_Mode          : Node_Id;
      Existing_Initial_Mode : Node_Id)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Kind (Initial_Mode) = K_Mode);
      pragma Assert (Kind (Initial_Mode) = K_Mode);

   begin
      Set_Standard_Error;

      Write_Str (Image (Loc (Initial_Mode)));
      Write_Str (": initial mode conflicts with another one at ");
      Write_Line (Image (Loc (Existing_Initial_Mode)));

      Set_Standard_Output;
   end Display_Conflicting_Initial_Modes;

   --------------------------------
   -- Display_Link_To_Wrong_Node --
   --------------------------------

   procedure Display_Link_To_Wrong_Node
     (Node         : Node_Id;
      Pointed_Node : Node_Id;
      Warning      : Boolean := False;
      Non_Existent : Boolean := False)
   is
      use Ocarina.ME_AADL;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Namet;
      use Ocarina.Me_AADL.AADL_Tree.Debug;
      use Output;

      pragma Assert (Present (Node));

   begin
      Set_Standard_Error;
      Write_Str (Image (Ocarina.Me_AADL.AADL_Tree.Nodes.Loc (Node)) & ": ");

      if Warning then
         Write_Str ("warning: ");
      end if;

      if Get_Entity_Category (Node) /= EC_Undefined then
         Write_Name (Get_Name_Of_Entity (Node, Get_Display_Name => True));
      elsif Kind (Node) = K_Entity_Reference then
         Write_Name (Get_Name_Of_Entity_Reference (Node,
                                                   Get_Display_Name => True));
      end if;

      Write_Str (" (" & Image (Kind (Node)) & ")");

      if Present (Pointed_Node) then
         Write_Str (" points to ");

         if Get_Entity_Category (Pointed_Node) /= EC_Undefined then
            Write_Name (Get_Name_Of_Entity (Pointed_Node,
                                            Get_Display_Name => True));
         elsif Kind (Pointed_Node) = K_Entity_Reference then
            Write_Name (Get_Name_Of_Entity_Reference
                        (Pointed_Node, Get_Display_Name => True));
         end if;
         Write_Str (" (" & Image (Kind (Pointed_Node)) & ")");

         if Non_Existent then
            Write_Str (", which does not exist. ");
            if Kind (Pointed_Node) = K_Entity_Reference then
               Is_Bad_Spelling (Get_Name_Of_Entity_Reference
                                  (Pointed_Node,
                                   Get_Display_Name => True));
            end if;
         else
            Write_Str (", which is not of an adequate kind");
         end if;
      else
         Write_Str (" does not point to anything or to something unreachable");
      end if;

      Write_Eol;
      Set_Standard_Output;
   end Display_Link_To_Wrong_Node;

   -----------------------------------------
   -- Display_Incompatible_Property_Types --
   -----------------------------------------

   procedure Display_Incompatible_Property_Types
     (Property_Association : Node_Id;
      Property_Value       : Node_Id;
      Property_Name        : Node_Id)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Kind (Property_Name) = K_Property_Definition_Declaration);
      pragma Assert (Present (Property_Value));

   begin
      Set_Standard_Error;

      Write_Str (Image (Loc (Property_Value)));
      Write_Str (": when evaluating the value of ");
      Write_Str (Get_Name_Of_Entity (Property_Association));

      Write_Str (", the value");

      if Kind (Property_Value) /= K_Property_Value then
         Write_Str (" ("
                    & Property_Type'Image
                    (Get_Type_Of_Property_Value (Property_Value))
                    & ")");
         --  We only display the type if the property value is explicit
      end if;

      Write_Str (" is not conformant with declaration at ");
      Write_Str (Image (Loc (Property_Name)));
      Write_Line (" ("
                  & Property_Type'Image
                  (Get_Type_Of_Property (Property_Name))
                  & ")");

      Set_Standard_Output;
   end Display_Incompatible_Property_Types;

   ----------------------------------------
   -- Display_Inconsistent_Property_Type --
   ----------------------------------------

   procedure Display_Inconsistent_Property_Type (Property_Type : Node_Id) is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Present (Property_Type));
   begin
      Set_Standard_Error;
      Write_Str (Image (Loc (Property_Type)));
      Write_Line (": property type is inconsistent");
      Set_Standard_Output;
   end Display_Inconsistent_Property_Type;

   ----------------------------------------------
   -- Display_Inconsistency_In_Property_Values --
   ----------------------------------------------

   procedure Display_Inconsistency_In_Property_Values
     (Property_Value1    : Node_Id;
      Property_Value2    : Node_Id;
      Reference_Property : Node_Id)
   is
      use Output;
      use Namet;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;
      use Ocarina.Me_AADL.AADL_Tree.Debug;

      pragma Assert (Present (Property_Value1));
      pragma Assert (Present (Property_Value2));
      pragma Assert
        (No (Reference_Property)
         or else Kind (Reference_Property) = K_Property_Association
         or else Kind (Reference_Property) = K_Property_Definition_Declaration
         or else Kind (Reference_Property) = K_Property_Type_Declaration
         or else Kind (Reference_Property) = K_Constant_Property_Declaration);
   begin
      Set_Standard_Error;
      Write_Str (Image (Loc (Reference_Property)));
      Write_Str (": when evaluating the value of ");
      Write_Name (Get_Name_Of_Entity (Reference_Property));
      Write_Str (", the value at ");
      Write_Str (Image (Loc (Property_Value1)));
      Write_Str (" (");

      if Kind (Property_Value1) = K_List_Id then
         if First_Node (List_Id (Property_Value1)) /= No_Node then
            Write_Str ("list of ");
            Write_Str (Image (Kind (First_Node (List_Id (Property_Value1)))));
         else
            Write_Str ("list");
         end if;
      else
         if Next_Node (Property_Value1) /= No_Node then
            Write_Str ("list of ");
         end if;

         Write_Str (Image (Kind (Property_Value1)));
      end if;

      Write_Str (") is inconsistent with "
                 & "the other one declared at ");
      Write_Str (Image (Loc (Property_Value2)));
      Write_Str (" (");

      if Kind (Property_Value2) = K_List_Id then
         if First_Node (List_Id (Property_Value2)) /= No_Node then
            Write_Str ("list of ");
            Write_Str (Image (Kind (First_Node (List_Id (Property_Value2)))));
         else
            Write_Str ("list");
         end if;
      else
         if Next_Node (Property_Value2) /= No_Node then
            Write_Str ("list of ");
         end if;

         Write_Str (Image (Kind (Property_Value2)));
      end if;

      Write_Line (")");
      Set_Standard_Output;
   end Display_Inconsistency_In_Property_Values;

   ---------------------------------------
   -- Display_Property_List_Discrepancy --
   ---------------------------------------

   procedure Display_Property_List_Discrepancy
     (Property_Association : Node_Id;
      Property_Name        : Node_Id)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Kind (Property_Name) = K_Property_Definition_Declaration);
      pragma Assert (Kind (Property_Association) = K_Property_Association);

   begin
      Set_Standard_Error;

      Write_Str (Image (Loc (Property_Association)));
      Write_Str (": ");
      Write_Str (Get_Name_Of_Entity (Property_Association));

      if Type_Of_Property_Is_A_List (Property_Association) then
         Write_Str (" is a list while the corresponding property name at ");
      else
         Write_Str
           (" is not a list while the corresponding property name at ");
      end if;

      Write_Str (Image (Loc (Property_Name)));

      if Type_Of_Property_Is_A_List (Property_Name) then
         Write_Line (" is a list.");
      else
         Write_Line
           (" is not a list.");
      end if;

      Set_Standard_Output;
   end Display_Property_List_Discrepancy;

   -----------------------------------------
   -- Display_Conversion_To_Property_List --
   -----------------------------------------

   procedure Display_Conversion_To_Property_List
     (Property_Association : Node_Id;
      Property_Name        : Node_Id)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Kind (Property_Name) = K_Property_Definition_Declaration);
      pragma Assert (Kind (Property_Association) = K_Property_Association);

   begin
      Set_Standard_Error;

      Write_Str (Image (Loc (Property_Association)));
      Write_Str (": Warning: ");
      Write_Str (Get_Name_Of_Entity (Property_Association));
      Write_Str (" is not a list while the corresponding property name at ");
      Write_Str (Image (Loc (Property_Name)));
      Write_Line (" is a list.");
      Write_Str ("The value of ");
      Write_Str (Get_Name_Of_Entity (Property_Association));
      Write_Line (" has been converted into a list.");

      Set_Standard_Output;
   end Display_Conversion_To_Property_List;

   -------------------------------------
   -- Display_Property_Not_Applicable --
   -------------------------------------

   procedure Display_Property_Not_Applicable
     (Property_Association : Node_Id;
      Entity               : Node_Id)
   is
      use Output;
      use Ocarina.Me_AADL.AADL_Tree.Nodes;

      pragma Assert (Kind (Property_Association) = K_Property_Association);
      pragma Assert (Present (Entity));
   begin
      Set_Standard_Error;

      Write_Str (Image (Loc (Property_Association)));
      Write_Str (": ");
      Write_Str (Get_Name_Of_Entity (Property_Association));
      Write_Str (" cannot apply to ");
      Write_Line (Get_Name_Of_Entity (Entity));

      Set_Standard_Output;
   end Display_Property_Not_Applicable;

end Ocarina.Analyzer.Messages;