OpenAADL / ocarina

@@ -38,6 +38,7 @@
Loading
38 38
with Ocarina.ME_AADL.AADL_Instances.Nodes;
39 39
with Ocarina.ME_AADL.AADL_Tree.Nodes;
40 40
with Ocarina.ME_AADL.AADL_Tree.Nutils;
41 +
with Ocarina.ME_AADL.AADL_Tree.Entities;
41 42
with Ocarina.ME_AADL.AADL_Instances.Entities;
42 43
with Ocarina.Backends.XML_Tree.Nodes;
43 44
with Ocarina.Backends.XML_Tree.Nutils;
@@ -53,6 +54,8 @@
Loading
53 54
   use Ocarina.Backends.AADL_XML.Mapping;
54 55
   use Ocarina.Backends.Utils;
55 56
57 +
   package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
58 +
   package ATE renames Ocarina.ME_AADL.AADL_Tree.Entities;
56 59
   package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
57 60
   package XTN renames Ocarina.Backends.XML_Tree.Nodes;
58 61
   use type ATN.Node_Kind;
@@ -405,38 +408,11 @@
Loading
405 408
   begin
406 409
      if Present (AADL_Property_Value)
407 410
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Signed_AADLNumber
408 -
        and then Present (ATN.Unit_Identifier (AADL_Property_Value))
409 411
      then
410 -
         --  This property value denotes a property with a unit
411 -
         --  identifier.
412 +
         --  This property value denotes a number property which can
413 +
         --  be aadlinteger or aadlreal with or without an unit
412 414
413 -
         Value_Node := Make_XML_Node ("unit");
414 -
415 -
         Append_Node_To_List
416 -
           (Make_Assignement
417 -
              (Make_Defining_Identifier (Get_String_Name ("value")),
418 -
               Make_Defining_Identifier
419 -
                 (Get_String_Name
420 -
                    (Ocarina.AADL_Values.Image
421 -
                       (ATN.Value
422 -
                         (ATN.Number_Value
423 -
                            (AADL_Property_Value)))))),
424 -
            XTN.Items (Value_Node));
425 -
426 -
         Append_Node_To_List
427 -
           (Make_Assignement
428 -
              (Make_Defining_Identifier (Get_String_Name ("unit")),
429 -
               Make_Defining_Identifier
430 -
                 (ATN.Display_Name
431 -
                    (ATN.Unit_Identifier (AADL_Property_Value)))),
432 -
            XTN.Items (Value_Node));
433 -
434 -
      elsif Present (AADL_Property_Value)
435 -
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Signed_AADLNumber
436 -
      then
437 -
         --  This property value denotes a aadlinteger property
438 -
439 -
         Value_Node := Make_XML_Node ("value");
415 +
         Value_Node := Make_XML_Node ("number");
440 416
441 417
         Append_Node_To_List
442 418
           (Make_Assignement
@@ -449,12 +425,22 @@
Loading
449 425
                             (AADL_Property_Value)))))),
450 426
            XTN.Items (Value_Node));
451 427
428 +
         if Present (ATN.Unit_Identifier (AADL_Property_Value)) then
429 +
            Append_Node_To_List
430 +
              (Make_Assignement
431 +
                 (Make_Defining_Identifier (Get_String_Name ("unit")),
432 +
                  Make_Defining_Identifier
433 +
                    (ATN.Display_Name
434 +
                       (ATN.Unit_Identifier (AADL_Property_Value)))),
435 +
            XTN.Items (Value_Node));
436 +
         end if;
437 +
452 438
      elsif Present (AADL_Property_Value)
453 439
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Literal
454 440
      then
455 -
         --  This property value denotes a literal
441 +
         --  This property value denotes a literal term
456 442
457 -
         Value_Node := Make_XML_Node ("value");
443 +
         Value_Node := Make_XML_Node ("string");
458 444
459 445
         Append_Node_To_List
460 446
           (Make_Assignement
@@ -484,12 +470,29 @@
Loading
484 470
                           (AADL_Property_Value)))))),
485 471
            XTN.Items (Value_Node));
486 472
473 +
      elsif Present (AADL_Property_Value)
474 +
        and then ATN.Kind (AADL_Property_Value) =
475 +
          ATN.K_Component_Classifier_Term
476 +
      then
477 +
         --  This property value denotes a classifier term
478 +
479 +
         Value_Node := Make_XML_Node ("classifier");
480 +
481 +
         Append_Node_To_List
482 +
           (Make_Assignement
483 +
              (Make_Defining_Identifier (Get_String_Name ("value")),
484 +
                 Make_Defining_Identifier
485 +
                   (AIN.Display_Name
486 +
                      (AIN.Identifier
487 +
                         (ATE.Get_Referenced_Entity (AADL_Property_Value))))),
488 +
               XTN.Items (Value_Node));
489 +
487 490
      elsif Present (AADL_Property_Value)
488 491
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Enumeration_Term
489 492
      then
490 493
         --  This property value denotes an enumeration term
491 494
492 -
         Value_Node := Make_XML_Node ("value");
495 +
         Value_Node := Make_XML_Node ("enumeration");
493 496
494 497
         Append_Node_To_List
495 498
           (Make_Assignement
@@ -546,6 +549,47 @@
Loading
546 549
               XTN.Items (Value_Node));
547 550
         end if;
548 551
552 +
      elsif Present (AADL_Property_Value)
553 +
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Record_Term
554 +
      then
555 +
         --  This property value denotes a record term
556 +
557 +
         Value_Node := Make_XML_Node ("record");
558 +
         List_Node :=
559 +
           ATN.First_Node (ATN.List_Items (AADL_Property_Value));
560 +
561 +
         declare
562 +
            Record_Field_Node       : Node_Id;
563 +
         begin
564 +
            while Present (List_Node) loop
565 +
566 +
               if ATN.Kind (List_Node) = ATN.K_Record_Term_Element then
567 +
568 +
                  Record_Field_Node := Make_XML_Node ("record_field");
569 +
570 +
                  Append_Node_To_List
571 +
                    (Record_Field_Node,
572 +
                     XTN.Subitems (Value_Node));
573 +
574 +
                  Append_Node_To_List
575 +
                    (Make_Assignement
576 +
                       (Make_Defining_Identifier (Get_String_Name ("name")),
577 +
                        Make_Defining_Identifier
578 +
                          (ATN.Display_Name (ATN.Identifier (List_Node)))),
579 +
                     XTN.Items (Record_Field_Node));
580 +
581 +
                  --  Visit record field's value
582 +
583 +
                  Append_Node_To_List
584 +
                    (Visit_Property_Value
585 +
                       (ATN.Property_Expression (List_Node)),
586 +
                     XTN.Subitems (Record_Field_Node));
587 +
               end if;
588 +
589 +
               List_Node := ATN.Next_Node (List_Node);
590 +
            end loop;
591 +
         end;
592 +
549 593
      elsif Present (AADL_Property_Value)
550 594
        and then ATN.Kind (AADL_Property_Value) = ATN.K_Property_List_Value
551 595
      then
Files Coverage
src 70.58%
Project Totals (369 files) 70.58%
1
ignore:
2
  - "tools/mknodes"
3
  - "src/frontends/aadl_ema"
4
  - "src/frontends/ao4aadl"
5
  - "src/transfo"
6
  - "doc"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading