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

Fix Asis.Elements and add next test

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.