Set_Is_Pure (Standard_Standard);
Set_Is_Compilation_Unit (Standard_Standard);
- -- Create type declaration nodes for standard types
+ -- Create type/subtype declaration nodes for standard types
for S in S_Types loop
- Decl := New_Node (N_Full_Type_Declaration, Stloc);
- Set_Defining_Identifier (Decl, Standard_Entity (S));
+
+ -- Subtype declaration case
+
+ if S = S_Natural or else S = S_Positive then
+ Decl := New_Node (N_Subtype_Declaration, Stloc);
+ Set_Subtype_Indication (Decl,
+ New_Occurrence_Of (Standard_Integer, Stloc));
+
+ -- Full type declaration case
+
+ else
+ Decl := New_Node (N_Full_Type_Declaration, Stloc);
+ end if;
+
Set_Is_Frozen (Standard_Entity (S));
Set_Is_Public (Standard_Entity (S));
+ Set_Defining_Identifier (Decl, Standard_Entity (S));
Append (Decl, Decl_S);
end loop;
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
- -- Create subtype declaration for Natural
-
- Decl := New_Node (N_Subtype_Declaration, Stloc);
- Set_Defining_Identifier (Decl, Standard_Natural);
- Set_Subtype_Indication (Decl,
- New_Occurrence_Of (Standard_Integer, Stloc));
- Append (Decl, Decl_S);
+ -- Setup entity for Naturalend Create_Standard;
Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Natural);
- Set_Is_Frozen (Standard_Natural);
- Set_Is_Public (Standard_Natural);
-
- -- Create subtype declaration for Positive
- Decl := New_Node (N_Subtype_Declaration, Stloc);
- Set_Defining_Identifier (Decl, Standard_Positive);
- Set_Subtype_Indication (Decl,
- New_Occurrence_Of (Standard_Integer, Stloc));
- Append (Decl, Decl_S);
+ -- Setup entity for Positive
Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
Lb => Uint_1,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Positive);
- Set_Is_Frozen (Standard_Positive);
- Set_Is_Public (Standard_Positive);
-- Create declaration for package ASCII
S_Standard,
S_ASCII,
- -- Types defined in package Standard
+ -- Types and subtypes defined in package Standard (in the order in which
+ -- they appear in the RM, so that the declarations are in the right
+ -- order for the purposes of ASIS traversals
S_Boolean,
- S_Character,
- S_Wide_Character,
- S_Wide_Wide_Character,
- S_String,
- S_Wide_String,
- S_Wide_Wide_String,
- S_Duration,
S_Short_Short_Integer,
S_Short_Integer,
S_Long_Integer,
S_Long_Long_Integer,
+ S_Natural,
+ S_Positive,
+
S_Short_Float,
S_Float,
S_Long_Float,
S_Long_Long_Float,
+ S_Character,
+ S_Wide_Character,
+ S_Wide_Wide_Character,
+
+ S_String,
+ S_Wide_String,
+ S_Wide_Wide_String,
+
+ S_Duration,
+
-- Enumeration literals for type Boolean
S_False,
S_True,
- -- Subtypes declared in package Standard
-
- S_Natural,
- S_Positive,
-
-- Exceptions declared in package Standard
S_Constraint_Error,
S_DEL); -- 16#7F#
subtype S_Types is
- Standard_Entity_Type range S_Boolean .. S_Long_Long_Float;
+ Standard_Entity_Type range S_Boolean .. S_Duration;
subtype S_Exceptions is
Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error;