OpenAADL / ocarina

@@ -67,6 +67,7 @@
Loading
67 67
   procedure Visit_Connection_Entity
68 68
     (Entity_XML_Node : Node_Id;
69 69
      Entity_Node     : Node_Id);
70 +
   function Visit_Properties (E : Node_Id) return Node_Id;
70 71
   function Visit_Property_Value
71 72
     (AADL_Property_Value : Node_Id) return Node_Id;
72 73
@@ -170,15 +171,11 @@
Loading
170 171
      Old_XML_Node        : Node_Id;
171 172
      Subcomponents_Node  : Node_Id;
172 173
      Features_Node       : Node_Id;
173 -
      Properties_Node     : Node_Id;
174 174
      Feature_Node        : Node_Id;
175 175
      F                   : Node_Id;
176 176
      P                   : Node_Id;
177 177
      U                   : Node_Id;
178 -
      Property_Node       : Node_Id;
179 178
      Components_Node     : Node_Id;
180 -
      Property_Value_Node : Node_Id;
181 -
      AADL_Property_Value : Node_Id;
182 179
      Connections_Node    : Node_Id;
183 180
      Connection_Node     : Node_Id;
184 181
@@ -328,69 +325,7 @@
Loading
328 325
329 326
      --  Properties
330 327
331 -
      Properties_Node := Make_XML_Node ("properties");
332 -
      Append_Node_To_List (Properties_Node, XTN.Subitems (N));
333 -
334 -
      if Present (Properties (E)) then
335 -
         F := First_Node (Properties (E));
336 -
         while Present (F) loop
337 -
            --  XXX Warning, if there are multiple values for a
338 -
            --  property (e.g. because of inheritance), then all
339 -
            --  values are dumped.
340 -
341 -
            Property_Node := Make_XML_Node ("property");
342 -
343 -
            Append_Node_To_List
344 -
              (Make_Assignement
345 -
                 (Make_Defining_Identifier (Get_String_Name ("name")),
346 -
                  Make_Defining_Identifier (Display_Name (Identifier (F)))),
347 -
               XTN.Items (Property_Node));
348 -
349 -
            Property_Value_Node := Make_XML_Node ("property_value");
350 -
            Append_Node_To_List
351 -
              (Property_Value_Node,
352 -
               XTN.Subitems (Property_Node));
353 -
354 -
            declare
355 -
               use Ocarina.ME_AADL.AADL_Tree.Nutils; -- for New_Node
356 -
               Property_Association_Value_Node : Node_Id;
357 -
            begin
358 -
               Property_Association_Value_Node :=
359 -
                 Property_Association_Value
360 -
                   (Get_Property_Association
361 -
                     (E,
362 -
                      Name (Identifier (F))));
363 -
364 -
               if ATN.Single_Value (Property_Association_Value_Node) = No_Node
365 -
               then
366 -
                  --  Wrap Multi_Value, a List_Id, in a K_Property_List_Value
367 -
                  --  node for further processing
368 -
369 -
                  AADL_Property_Value :=
370 -
                    New_Node
371 -
                      (ATN.K_Property_List_Value,
372 -
                       ATN.Loc (Property_Association_Value_Node));
373 -
374 -
                  ATN.Set_Property_Values
375 -
                    (AADL_Property_Value,
376 -
                     ATN.Multi_Value (Property_Association_Value_Node));
377 -
378 -
               else
379 -
                  AADL_Property_Value :=
380 -
                    Compute_Property_Value (Property_Association_Value_Node);
381 -
               end if;
382 -
            end;
383 -
384 -
            Append_Node_To_List
385 -
              (Visit_Property_Value (AADL_Property_Value),
386 -
               XTN.Subitems (Property_Value_Node));
387 -
388 -
            Append_Node_To_List
389 -
              (Property_Node,
390 -
               XTN.Subitems (Properties_Node));
391 -
            F := Next_Node (F);
392 -
         end loop;
393 -
      end if;
328 +
      Append_Node_To_List (Visit_Properties (E), XTN.Subitems (N));
394 329
395 330
      --  Connections
396 331
@@ -430,6 +365,11 @@
Loading
430 365
               Append_Node_To_List (Dst_Node, XTN.Subitems (Connection_Node));
431 366
            end;
432 367
368 +
            --  Properties of the connection
369 +
370 +
            Append_Node_To_List
371 +
              (Visit_Properties (F), XTN.Subitems (Connection_Node));
372 +
433 373
            Append_Node_To_List
434 374
              (Connection_Node, XTN.Subitems (Connections_Node));
435 375
            F := Next_Node (F);
@@ -490,6 +430,81 @@
Loading
490 430
      end if;
491 431
   end Visit_Connection_Entity;
492 432
433 +
   ----------------------
434 +
   -- Visit_Properties --
435 +
   ----------------------
436 +
437 +
   function Visit_Properties
438 +
     (E : Node_Id) return Node_Id
439 +
   is
440 +
      Properties_Node                 : Node_Id;
441 +
      F                               : Node_Id;
442 +
      Property_Node                   : Node_Id;
443 +
      Property_Value_Node             : Node_Id;
444 +
      AADL_Property_Value             : Node_Id;
445 +
      Property_Association_Value_Node : Node_Id;
446 +
   begin
447 +
      Properties_Node := Make_XML_Node ("properties");
448 +
449 +
      if Present (Properties (E)) then
450 +
         F := First_Node (Properties (E));
451 +
         while Present (F) loop
452 +
            --  XXX Warning, if there are multiple values for a
453 +
            --  property (e.g. because of inheritance), then all
454 +
            --  values are dumped.
455 +
456 +
            Property_Node := Make_XML_Node ("property");
457 +
458 +
            Append_Node_To_List
459 +
              (Make_Assignement
460 +
                 (Make_Defining_Identifier (Get_String_Name ("name")),
461 +
                  Make_Defining_Identifier (Display_Name (Identifier (F)))),
462 +
               XTN.Items (Property_Node));
463 +
464 +
            Property_Value_Node := Make_XML_Node ("property_value");
465 +
            Append_Node_To_List
466 +
              (Property_Value_Node,
467 +
               XTN.Subitems (Property_Node));
468 +
469 +
            Property_Association_Value_Node :=
470 +
              Property_Association_Value
471 +
                (Get_Property_Association
472 +
                   (E,
473 +
                    Name (Identifier (F))));
474 +
475 +
            if ATN.Single_Value (Property_Association_Value_Node) = No_Node
476 +
            then
477 +
               --  Wrap Multi_Value, a List_Id, in a K_Property_List_Value
478 +
               --  node for further processing
479 +
480 +
               AADL_Property_Value :=
481 +
                 Ocarina.ME_AADL.AADL_Tree.Nutils.New_Node
482 +
                   (ATN.K_Property_List_Value,
483 +
                    ATN.Loc (Property_Association_Value_Node));
484 +
485 +
               ATN.Set_Property_Values
486 +
                 (AADL_Property_Value,
487 +
                  ATN.Multi_Value (Property_Association_Value_Node));
488 +
489 +
            else
490 +
               AADL_Property_Value :=
491 +
                 Compute_Property_Value (Property_Association_Value_Node);
492 +
            end if;
493 +
494 +
            Append_Node_To_List
495 +
              (Visit_Property_Value (AADL_Property_Value),
496 +
               XTN.Subitems (Property_Value_Node));
497 +
498 +
            Append_Node_To_List
499 +
              (Property_Node,
500 +
               XTN.Subitems (Properties_Node));
501 +
            F := Next_Node (F);
502 +
         end loop;
503 +
      end if;
504 +
505 +
      return Properties_Node;
506 +
   end Visit_Properties;
507 +
493 508
   --------------------------
494 509
   -- Visit_Property_Value --
495 510
   --------------------------
Files Coverage
src 70.60%
Project Totals (369 files) 70.60%
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