<CompilationUnit records.ads:2:1-130:13>
<AdaNodeList records.ads:2:1-4:23>
<WithClause records.ads:2:1-2:30>
<LimitedAbsent records.ads:2:1-2:1>
<PrivateAbsent records.ads:2:1-2:1>
<NameList records.ads:2:6-2:29>
<DottedName records.ads:2:6-2:29>
<Id "System" records.ads:2:6-2:12>
<Id "Storage_Elements" records.ads:2:13-2:29>
<WithClause records.ads:4:1-4:23>
<LimitedAbsent records.ads:2:30-2:30>
<PrivateAbsent records.ads:2:30-2:30>
<NameList records.ads:4:6-4:22>
<Id "All_Enumerations" records.ads:4:6-4:22>
<LibraryItem records.ads:6:1-130:13>
<PrivateAbsent records.ads:4:23-4:23>
<PackageDecl ["Records"] records.ads:6:1-130:13>
**************************
\/ RAW <<HEADER>> ()  0 0 0 0
\/ RAW <<INTERMEDIATE UPPER>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
package Records
\/ DESCRIPTION  ()  0 0 0 0
**************************
<DefiningName "Records" records.ads:6:9-6:16>
<Id "Records" records.ads:6:9-6:16>
<PublicPart records.ads:6:19-130:1>
<AdaNodeList records.ads:8:4-128:28>
<ConcreteTypeDecl ["Record_Type_1"] records.ads:8:4-10:15>
**************************
\/ FIELD a (A)  8 8 9 8
Discriminant
\/ FIELD x (X)  9 9 10 9
Value of X
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
Record type with discriminant

@field A Discriminant
@field X Value of X
\/ SNIPPET ada ()  0 0 0 0
type Record_Type_1 (A : Boolean) is record
   X : Integer with Atomic, Volatile;
end record;
\/ DESCRIPTION  ()  0 0 0 0
Record type with discriminant
**************************
<ConcreteTypeDecl ["Record_Type_2"] records.ads:16:4-39:15>
**************************
\/ FIELD k (K)  17 17 18 18
Description of the discriminant
\/ FIELD x (X)  22 22 23 23
This is decsription of X component.
\/ FIELD y (Y)  30 30 31 31
This is description of Y component.
\/ FIELD z (Z)  37 37 38 38
Description of the Z member
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
This is complex declaration of the record type with discriminants and
alternatives.

@field Z  Description of the Z member
\/ SNIPPET ada ()  0 0 0 0
type Record_Type_2
  (K : All_Enumerations.Enumeration_Type_1) is
record
   case K is
      when All_Enumerations.A | All_Enumerations.B =>
         X : Integer;
         case K is
            when All_Enumerations.A =>
               null;
            when All_Enumerations.B =>
               Y : Integer;
            when others =>
               null;
         end case;
      when All_Enumerations.C =>
         Z : Integer;
   end case;
end record;
\/ DESCRIPTION  ()  0 0 0 0
This is complex declaration of the record type with discriminants and
alternatives.
**************************
<ConcreteTypeDecl ["Character_Offset"] records.ads:49:4-49:59>
**************************
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
type Character_Offset is range -2 ** 30 .. 2 ** 30 - 1;
\/ DESCRIPTION  ()  0 0 0 0
**************************
<SubtypeDecl ["Character_Count"] records.ads:50:4-51:39>
**************************
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
subtype Character_Count is Character_Offset
  range 0 .. Character_Offset'Last;
\/ DESCRIPTION  ()  0 0 0 0
**************************
<ConcreteTypeDecl ["Abstract_String_Handler"] records.ads:53:4-53:54>
**************************
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
type Abstract_String_Handler is limited interface;
\/ DESCRIPTION  ()  0 0 0 0
**************************
<ConcreteTypeDecl ["String_Handler_Access"] records.ads:55:4-55:75>
**************************
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
type String_Handler_Access is access all Abstract_String_Handler'Class;
\/ DESCRIPTION  ()  0 0 0 0
**************************
<ConcreteTypeDecl ["String_Data"] records.ads:57:4-72:15>
**************************
\/ FIELD in_place (In_Place)  57 57 58 57
\/ FIELD capacity (Capacity)  58 58 59 59
\/ FIELD padding (Padding)  60 60 61 63
This padding bit is not used in the code, but here for the benefit
of dynamic memory analysis tools such as valgrind.
\/ FIELD storage (Storage)  66 66 67 67
\/ FIELD handler (Handler)  69 69 71 71
\/ FIELD pointer (Pointer)  70 70 71 71
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
String_Data is a pair of Handler and pointer to the associated data.
It is not defined how particular implementation of the String_Handler
use pointer.

However, there is one exception: when In_Place Flag is set it means
that special predefined handler is used to process Storage.

Note: data layout is optimized for x86-64 CPU.
Note: Storage has 4 bytes alignment.
\/ SNIPPET ada ()  0 0 0 0
type String_Data (In_Place : Boolean := False) is record
   Capacity : Character_Count := 0;
   Padding  : Boolean := False;
   case In_Place is
      when True =>
         Storage : System.Storage_Elements.Storage_Array (0 .. 19);
      when False =>
         Handler : String_Handler_Access;
         Pointer : System.Address;
   end case;
end record;
\/ DESCRIPTION  ()  0 0 0 0
String_Data is a pair of Handler and pointer to the associated data.
It is not defined how particular implementation of the String_Handler
use pointer.

However, there is one exception: when In_Place Flag is set it means
that special predefined handler is used to process Storage.

Note: data layout is optimized for x86-64 CPU.
Note: Storage has 4 bytes alignment.
**************************
<RecordRepClause records.ads:73:4-80:15>
<ConcreteTypeDecl ["My_Type"] records.ads:95:4-100:15>
**************************
\/ FIELD a (A)  96 96 97 97
This is a comment for A
\/ FIELD b (B)  98 98 99 99
This is a comment for B
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
Comments for both fields must be extracted from the comments around.
\/ SNIPPET ada ()  0 0 0 0
type My_Type is record
   A : Integer;
   B : Integer;
end record;
\/ DESCRIPTION  ()  0 0 0 0
Comments for both fields must be extracted from the comments around.
**************************
<ConcreteTypeDecl ["Foo_1"] records.ads:107:4-120:15>
**************************
\/ FIELD x (X)  107 107 108 107
\/ FIELD a (A)  110 110 111 110
\/ FIELD b (B)  112 112 113 112
\/ FIELD c (C)  114 114 115 114
\/ FIELD d (D)  116 116 117 116
\/ FIELD e (E)  118 118 119 119
\/ RAW <<LEADING>> ()  0 0 0 0
\/ RAW <<TRAILING>> ()  0 0 0 0
This is example of the record type with discriminant of integer type and
variant part that depends from few kind of values.
\/ SNIPPET ada ()  0 0 0 0
type Foo_1 (X : Integer) is record
   case X is
      when -6 =>
         A : Integer;
      when -5 | -4 =>
         B : Integer;
      when -3 .. -1 =>
         C : Integer;
      when Natural =>
         D : Integer;
      when others =>
         E : Integer;
   end case;
end record;
\/ DESCRIPTION  ()  0 0 0 0
This is example of the record type with discriminant of integer type and
variant part that depends from few kind of values.
**************************
<ConcreteTypeDecl ["My_Record"] records.ads:125:4-128:28>
**************************
\/ FIELD i (I)  126 126 127 127
\/ RAW <<LEADING>> ()  0 0 0 0
Remove of aspects from the code snippet.
\/ RAW <<TRAILING>> ()  0 0 0 0
\/ SNIPPET ada ()  0 0 0 0
type My_Record is tagged record
   I : Integer := 1;
end record;
\/ DESCRIPTION  ()  0 0 0 0
**************************
<EndName records.ads:130:5-130:12>
<Id "Records" records.ads:130:5-130:12>
<PragmaNodeList records.ads:130:13-130:13>
