Changeset 401


Ignore:
Timestamp:
Feb 16, 2015, 12:31:23 PM (5 years ago)
Author:
Maxim Reznik
Message:

Fix Asis.Elements and add next test

Location:
trunk/ada-2012
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ada-2012/src/asis/asis-declarations.adb

    r388 r401  
    1515with Gela.Compilations;
    1616with Gela.Element_Visiters;
     17with Gela.Elements.Basic_Declarative_Items;
    1718with Gela.Elements.Component_Declarations;
    1819with Gela.Elements.Component_Definitions;
    1920with Gela.Elements.Declarative_Items;
     21with Gela.Elements.Defining_Enumeration_Literals;
    2022with Gela.Elements.Defining_Identifiers;
     23with Gela.Elements.Defining_Operator_Symbols;
    2124with Gela.Elements.Defining_Program_Unit_Names;
    2225with Gela.Elements.Discriminant_Specifications;
     
    3033with Gela.Elements.Object_Renaming_Declarations;
    3134with Gela.Elements.Package_Bodies;
     35with Gela.Elements.Package_Declarations;
    3236with Gela.Elements.Parameter_Specifications;
    3337with Gela.Elements.Procedure_Bodies;
     
    4246with Gela.Elements.Type_Definitions;
    4347with Gela.Lexical_Types;
    44 with Gela.Elements.Defining_Enumeration_Literals;
    45 with Gela.Elements.Defining_Operator_Symbols;
    4648
    4749package body Asis.Declarations is
     
    14111413   is
    14121414      pragma Unreferenced (Include_Pragmas);
     1415      package Get is
     1416         type Visiter is new Gela.Element_Visiters.Visiter with record
     1417            List : Gela.Elements.Element_Sequence_Access;
     1418         end record;
     1419
     1420         overriding procedure Package_Declaration
     1421           (Self : in out Visiter;
     1422            Node : not null Gela.Elements.Package_Declarations.
     1423              Package_Declaration_Access);
     1424
     1425      end Get;
     1426
     1427      package body Get is
     1428
     1429         overriding procedure Package_Declaration
     1430           (Self : in out Visiter;
     1431            Node : not null Gela.Elements.Package_Declarations.
     1432              Package_Declaration_Access)
     1433         is
     1434            List : constant Gela.Elements.Basic_Declarative_Items.
     1435              Basic_Declarative_Item_Sequence_Access :=
     1436                Node.Private_Part_Declarative_Items;
     1437         begin
     1438            Self.List := Gela.Elements.Element_Sequence_Access (List);
     1439         end Package_Declaration;
     1440
     1441      end Get;
     1442
     1443      V : Get.Visiter;
    14131444   begin
    14141445      Check_Nil_Element (Declaration, "Private_Part_Declarative_Items");
    1415       Raise_Not_Implemented ("");
    1416       return Nil_Element_List;
     1446      Declaration.Data.Visit (V);
     1447
     1448      return Asis.To_List (V.List);
    14171449   end Private_Part_Declarative_Items;
    14181450
     
    15791611   is
    15801612      pragma Unreferenced (Include_Pragmas);
     1613
     1614      package Get is
     1615         type Visiter is new Gela.Element_Visiters.Visiter with record
     1616            List : Gela.Elements.Element_Sequence_Access;
     1617         end record;
     1618
     1619         overriding procedure Package_Declaration
     1620           (Self : in out Visiter;
     1621            Node : not null Gela.Elements.Package_Declarations.
     1622              Package_Declaration_Access);
     1623
     1624      end Get;
     1625
     1626      package body Get is
     1627
     1628         overriding procedure Package_Declaration
     1629           (Self : in out Visiter;
     1630            Node : not null Gela.Elements.Package_Declarations.
     1631              Package_Declaration_Access)
     1632         is
     1633            List : constant Gela.Elements.Basic_Declarative_Items.
     1634              Basic_Declarative_Item_Sequence_Access :=
     1635                Node.Visible_Part_Declarative_Items;
     1636         begin
     1637            Self.List := Gela.Elements.Element_Sequence_Access (List);
     1638         end Package_Declaration;
     1639
     1640      end Get;
     1641
     1642      V : Get.Visiter;
    15811643   begin
    15821644      Check_Nil_Element (Declaration, "Visible_Part_Declarative_Items");
    1583       Raise_Not_Implemented ("");
    1584       return Nil_Element_List;
     1645      Declaration.Data.Visit (V);
     1646
     1647      return Asis.To_List (V.List);
    15851648   end Visible_Part_Declarative_Items;
    15861649
  • trunk/ada-2012/src/asis/asis-elements.adb

    r400 r401  
    558558              A_Discrete_Simple_Expression_Range);
    559559
     560      Map_2 : constant array (F.A_Discrete_Subtype_Definition)
     561        of Asis.Discrete_Range_Kinds
     562        := (F.A_Discrete_Subtype_Indication =>
     563              A_Discrete_Subtype_Indication,
     564            F.A_Discrete_Range_Attribute_Reference =>
     565              A_Discrete_Range_Attribute_Reference,
     566            F.A_Discrete_Simple_Expression_Range =>
     567              A_Discrete_Simple_Expression_Range);
     568
    560569      Kind : constant Asis.Extensions.Flat_Kinds.Element_Flat_Kind :=
    561570        Asis.Extensions.Flat_Kinds.Flat_Kind (Definition);
     
    563572      if Kind in Map'Range then
    564573         return Map (Kind);
     574      elsif Kind in Map_2'Range then
     575         return Map_2 (Kind);
    565576      else
    566577         return Not_A_Discrete_Range;
  • trunk/ada-2012/src/asis/asis-extensions-flat_kinds.adb

    r400 r401  
    23202320      pragma Unreferenced (Node);
    23212321   begin
    2322       Self.Result := A_Discrete_Simple_Expression_Range;
     2322      Self.Result := A_Simple_Expression_Range;
    23232323   end Simple_Expression_Range;
    23242324
  • trunk/ada-2012/tests/asis/asis2xml.gpl/list.txt

    r400 r401  
    77./A/A2A031A.ADA 84672784
    88./A/A33003A.ADA 3558726738
     9./A/A34017C.ADA 3218990317
Note: See TracChangeset for help on using the changeset viewer.