Ignore:
Timestamp:
Apr 28, 2018, 11:25:32 AM (4 years ago)
Author:
Maxim Reznik
Message:

Split subtype_indication into two

scalar_subtype_indication and composite_subtype_indication.
This allows have different types for "Up" property.
scalar_subtype_indication has Interpretation_Set_Index and
composite_subtype_indication has Interpretation_Tuple_List_Index.
"Up" property of scalar_subtype_indication should have the same
type as expression, because both of them are membership_choice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ada-2012/src/semantic/gela-plain_type_views.adb

    r543 r547  
    44with Gela.Elements.Component_Declarations;
    55with Gela.Elements.Component_Items;
     6with Gela.Elements.Composite_Subtype_Indications;
    67with Gela.Elements.Defining_Identifiers;
    78with Gela.Elements.Discriminant_Specifications;
     
    910with Gela.Elements.Record_Definitions;
    1011with Gela.Elements.Record_Type_Definitions;
     12with Gela.Elements.Scalar_Subtype_Indications;
    1113with Gela.Elements.Variant_Parts;
    1214with Gela.Elements.Variants;
     
    238240   overriding function Get_Designated
    239241     (Self   : Type_View)
    240       return Gela.Elements.Subtype_Indications.Subtype_Indication_Access
     242      return Gela.Elements.Subtype_Marks.Subtype_Mark_Access
    241243   is
    242244      package Get is
    243245         type Visiter is new Gela.Element_Visiters.Visiter with record
    244             Result : Gela.Elements.Subtype_Indications.
    245               Subtype_Indication_Access;
     246            Result : Gela.Elements.Subtype_Marks. Subtype_Mark_Access;
    246247         end record;
    247248
     
    251252              Access_To_Object_Definition_Access);
    252253
     254         overriding procedure Composite_Subtype_Indication
     255           (Self : in out Visiter;
     256            Node : not null Gela.Elements.Composite_Subtype_Indications.
     257              Composite_Subtype_Indication_Access);
     258
     259         overriding procedure Scalar_Subtype_Indication
     260           (Self : in out Visiter;
     261            Node : not null Gela.Elements.Scalar_Subtype_Indications.
     262              Scalar_Subtype_Indication_Access);
     263
    253264      end Get;
    254265
     
    260271              Access_To_Object_Definition_Access) is
    261272         begin
    262             Self.Result := Node.Subtype_Indication;
     273            Node.Subtype_Indication.Visit (Self);
    263274         end Access_To_Object_Definition;
     275
     276         overriding procedure Composite_Subtype_Indication
     277           (Self : in out Visiter;
     278            Node : not null Gela.Elements.Composite_Subtype_Indications.
     279              Composite_Subtype_Indication_Access) is
     280         begin
     281            Self.Result := Node.Subtype_Mark;
     282         end Composite_Subtype_Indication;
     283
     284         overriding procedure Scalar_Subtype_Indication
     285           (Self : in out Visiter;
     286            Node : not null Gela.Elements.Scalar_Subtype_Indications.
     287              Scalar_Subtype_Indication_Access) is
     288         begin
     289            Self.Result := Node.Subtype_Mark;
     290         end Scalar_Subtype_Indication;
    264291
    265292      end Get;
Note: See TracChangeset for help on using the changeset viewer.