Changeset 320


Ignore:
Timestamp:
Nov 3, 2014, 1:29:29 PM (6 years ago)
Author:
Maxim Reznik
Message:

Add ASIS.Declarations and ASIS.Statements stubs

Location:
trunk/ada-2012/src/asis
Files:
2 edited
4 copied

Legend:

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

    r318 r320  
    1010--  Procedural wrapper over Object-Oriented ASIS implementation
    1111
     12with Asis.Elements;
     13with Asis.Compilation_Units;
     14
     15with Gela.Element_Visiters;
     16with Gela.Elements.Entry_Bodies;
     17with Gela.Elements.Function_Bodies;
     18with Gela.Elements.Package_Bodies;
     19with Gela.Elements.Procedure_Bodies;
     20with Gela.Elements.Task_Bodies;
     21with Gela.Elements.Statements;
     22
    1223package body Asis.Declarations is
    1324
     
    2233   begin
    2334      Check_Nil_Element (Declaration, "Body_Block_Statement");
    24       raise Unimplemented;
     35      Raise_Not_Implemented ("");
    2536      return Nil_Element;
    2637   end Body_Block_Statement;
     
    3546      return Asis.Element_List
    3647   is
     48      pragma Unreferenced (Include_Pragmas);
    3749   begin
    3850      Check_Nil_Element (Declaration, "Body_Declarative_Items");
    39       return Body_Declarative_Items (Declaration.all, Include_Pragmas);
     51      Raise_Not_Implemented ("");
     52      return Nil_Element_List;
    4053   end Body_Declarative_Items;
    4154
     
    4962      return Asis.Exception_Handler_List
    5063   is
     64      pragma Unreferenced (Include_Pragmas);
    5165   begin
    5266      Check_Nil_Element (Declaration, "Body_Exception_Handlers");
    53       return Body_Exception_Handlers (Declaration.all, Include_Pragmas);
     67      Raise_Not_Implemented ("");
     68      return Nil_Element_List;
    5469   end Body_Exception_Handlers;
    5570
     
    6378      return Asis.Statement_List
    6479   is
     80      pragma Unreferenced (Include_Pragmas);
     81
     82      package Get is
     83         type Visiter is new Gela.Element_Visiters.Visiter with record
     84            Result : Gela.Elements.Statements.Statement_Sequence_Access;
     85         end record;
     86
     87         overriding procedure Entry_Body
     88           (Self : in out Visiter;
     89            Node : not null Gela.Elements.Entry_Bodies.Entry_Body_Access);
     90
     91         overriding procedure Function_Body
     92           (Self : in out Visiter;
     93            Node : not null Gela.Elements.Function_Bodies.
     94              Function_Body_Access);
     95
     96         overriding procedure Package_Body
     97           (Self : in out Visiter;
     98            Node : not null Gela.Elements.Package_Bodies.Package_Body_Access);
     99
     100         overriding procedure Procedure_Body
     101           (Self : in out Visiter;
     102            Node : not null Gela.Elements.Procedure_Bodies.
     103              Procedure_Body_Access);
     104
     105         overriding procedure Task_Body
     106           (Self : in out Visiter;
     107            Node : not null Gela.Elements.Task_Bodies.Task_Body_Access);
     108
     109      end Get;
     110
     111      package body Get is
     112
     113         overriding procedure Entry_Body
     114           (Self : in out Visiter;
     115            Node : not null Gela.Elements.Entry_Bodies.Entry_Body_Access) is
     116         begin
     117            Self.Result := Node.Body_Statements;
     118         end Entry_Body;
     119
     120         overriding procedure Function_Body
     121           (Self : in out Visiter;
     122            Node : not null Gela.Elements.Function_Bodies.
     123              Function_Body_Access) is
     124         begin
     125            Self.Result := Node.Body_Statements;
     126         end Function_Body;
     127
     128         overriding procedure Package_Body
     129           (Self : in out Visiter;
     130            Node : not null Gela.Elements.Package_Bodies.Package_Body_Access)
     131         is
     132         begin
     133            Self.Result := Node.Body_Statements;
     134         end Package_Body;
     135
     136         overriding procedure Procedure_Body
     137           (Self : in out Visiter;
     138            Node : not null Gela.Elements.Procedure_Bodies.
     139              Procedure_Body_Access) is
     140         begin
     141            Self.Result := Node.Body_Statements;
     142         end Procedure_Body;
     143
     144         overriding procedure Task_Body
     145           (Self : in out Visiter;
     146            Node : not null Gela.Elements.Task_Bodies.Task_Body_Access) is
     147         begin
     148            Self.Result := Node.Body_Statements;
     149         end Task_Body;
     150
     151      end Get;
     152
     153      V : Get.Visiter;
     154      Result : Gela.Elements.Element_Sequence_Access;
    65155   begin
    66156      Check_Nil_Element (Declaration, "Body_Statements");
    67       return Body_Statements (Declaration.all, Include_Pragmas);
     157      Declaration.Data.Visit (V);
     158      Result := Gela.Elements.Element_Sequence_Access (V.Result);
     159
     160      return Asis.To_List (Result);
    68161   end Body_Statements;
    69162
     
    78171   begin
    79172      Check_Nil_Element (Declaration, "Corresponding_Base_Entity");
    80       return Corresponding_Base_Entity (Declaration.all);
     173      Raise_Not_Implemented ("");
     174      return Nil_Element;
    81175   end Corresponding_Base_Entity;
    82176
     
    90184   is
    91185   begin
    92       case Declaration_Kind (Declaration.all) is
     186      case Asis.Elements.Declaration_Kind (Declaration) is
    93187         when
    94188           A_Function_Body_Declaration
     
    115209
    116210      Check_Nil_Element (Declaration, "Corresponding_Body");
    117       return Corresponding_Body (Declaration.all);
     211      Raise_Not_Implemented ("");
     212      return Nil_Element;
    118213   end Corresponding_Body;
    119214
     
    127222      return Asis.Declaration
    128223   is
     224      pragma Unreferenced (The_Context);
    129225   begin
    130226      Check_Nil_Element (Declaration, "Corresponding_Body");
    131       Check_Context (The_Context);
    132       return Corresponding_Body (Declaration, The_Context.all);
     227--      Check_Context (The_Context);
     228      Raise_Not_Implemented ("");
     229      return Corresponding_Body (Declaration);
    133230   end Corresponding_Body;
    134231
     
    143240   begin
    144241      Check_Nil_Element (Subunit, "Corresponding_Body_Stub");
    145       return Corresponding_Body_Stub (Subunit.all);
     242      Raise_Not_Implemented ("");
     243      return Nil_Element;
    146244   end Corresponding_Body_Stub;
    147245
     
    155253      return Asis.Declaration
    156254   is
     255      pragma Unreferenced (The_Context);
    157256   begin
    158257      Check_Nil_Element (Subunit, "Corresponding_Body_Stub");
    159       Check_Context (The_Context);
    160       return Corresponding_Body_Stub (Subunit, The_Context.all);
     258--      Check_Context (The_Context);
     259      Raise_Not_Implemented ("");
     260      return Corresponding_Body_Stub (Subunit);
    161261   end Corresponding_Body_Stub;
    162262
     
    171271   begin
    172272      Check_Nil_Element (Name, "Corresponding_Constant_Declaration");
    173       return Corresponding_Constant_Declaration (Name.all);
     273      Raise_Not_Implemented ("");
     274      return Nil_Element;
    174275   end Corresponding_Constant_Declaration;
    175276
     
    183284   is
    184285   begin
    185       case Declaration_Kind (Declaration.all) is
     286      case Asis.Elements.Declaration_Kind (Declaration) is
    186287         when
    187288           A_Function_Declaration
     
    206307
    207308      Check_Nil_Element (Declaration, "Corresponding_Declaration");
    208       return Corresponding_Declaration (Declaration.all);
     309      Raise_Not_Implemented ("");
     310      return Nil_Element;
    209311   end Corresponding_Declaration;
    210312
     
    218320      return Asis.Declaration
    219321   is
     322      pragma Unreferenced (The_Context);
    220323   begin
    221324      Check_Nil_Element (Declaration, "Corresponding_Declaration");
    222       Check_Context (The_Context);
    223       return Corresponding_Declaration (Declaration, The_Context.all);
     325--      Check_Context (The_Context);
     326      Raise_Not_Implemented ("");
     327      return Corresponding_Declaration (Declaration);
    224328   end Corresponding_Declaration;
    225329
     
    234338   begin
    235339      Check_Nil_Element (Declaration, "Corresponding_Equality_Operator");
    236       return Corresponding_Equality_Operator (Declaration.all);
     340      Raise_Not_Implemented ("");
     341      return Nil_Element;
    237342   end Corresponding_Equality_Operator;
    238343
     
    248353      Check_Nil_Element (Declaration, "Corresponding_First_Subtype");
    249354
    250       case Declaration_Kind (Declaration.all) is
     355      case Asis.Elements.Declaration_Kind (Declaration) is
    251356         when An_Ordinary_Type_Declaration |
    252357           A_Task_Type_Declaration |
     
    257362            return Declaration;
    258363         when others =>
    259             return Corresponding_First_Subtype (Declaration.all);
     364            Raise_Not_Implemented ("");
     365            return Nil_Element;
    260366      end case;
    261367   end Corresponding_First_Subtype;
     
    271377   begin
    272378      Check_Nil_Element (Reference, "Corresponding_Generic_Element");
    273       return Corresponding_Generic_Element (Reference.all);
     379      Raise_Not_Implemented ("");
     380      return Nil_Element;
    274381   end Corresponding_Generic_Element;
    275382
     
    285392      Check_Nil_Element (Declaration, "Corresponding_Last_Constraint");
    286393
    287       case Declaration_Kind (Declaration.all) is
     394      case Asis.Elements.Declaration_Kind (Declaration) is
    288395         when An_Ordinary_Type_Declaration |
    289396           A_Task_Type_Declaration |
     
    294401            return Declaration;
    295402         when others =>
    296             return Corresponding_Last_Constraint (Declaration.all);
     403            Raise_Not_Implemented ("");
     404            return Nil_Element;
    297405      end case;
    298406   end Corresponding_Last_Constraint;
     
    309417      Check_Nil_Element (Declaration, "Corresponding_Last_Subtype");
    310418
    311       case Declaration_Kind (Declaration.all) is
     419      case Asis.Elements.Declaration_Kind (Declaration) is
    312420         when An_Ordinary_Type_Declaration |
    313421           A_Task_Type_Declaration |
     
    318426            return Declaration;
    319427         when others =>
    320             return Corresponding_Last_Subtype (Declaration.all);
     428            Raise_Not_Implemented ("");
     429            return Nil_Element;
    321430      end case;
    322431   end Corresponding_Last_Subtype;
     
    332441   begin
    333442      Check_Nil_Element (Declaration, "Corresponding_Representation_Clauses");
    334       return Corresponding_Representation_Clauses (Declaration.all);
     443      Raise_Not_Implemented ("");
     444      return Nil_Element_List;
    335445   end Corresponding_Representation_Clauses;
    336446
     
    345455   begin
    346456      Check_Nil_Element (Declaration, "Corresponding_Subprogram_Derivation");
    347       return Corresponding_Subprogram_Derivation (Declaration.all);
     457      Raise_Not_Implemented ("");
     458      return Nil_Element;
    348459   end Corresponding_Subprogram_Derivation;
    349460
     
    358469   begin
    359470      Check_Nil_Element (Body_Stub, "Corresponding_Subunit");
    360       return Corresponding_Subunit (Body_Stub.all);
     471      Raise_Not_Implemented ("");
     472      return Nil_Element;
    361473   end Corresponding_Subunit;
    362474
     
    370482      return Asis.Declaration
    371483   is
     484      pragma Unreferenced (The_Context);
    372485   begin
    373486      Check_Nil_Element (Body_Stub, "Corresponding_Subunit");
    374       Check_Context (The_Context);
    375       return Corresponding_Subunit (Body_Stub, The_Context.all);
     487--      Check_Context (The_Context);
     488      Raise_Not_Implemented ("");
     489      return Corresponding_Subunit (Body_Stub);
    376490   end Corresponding_Subunit;
    377491
     
    386500   begin
    387501      Check_Nil_Element (Declaration, "Corresponding_Type");
    388       return Corresponding_Type (Declaration.all);
     502      Raise_Not_Implemented ("");
     503      return Nil_Element;
    389504   end Corresponding_Type;
    390505
     
    399514   begin
    400515      Check_Nil_Element (Declaration, "Corresponding_Type_Declaration");
    401       return Corresponding_Type_Declaration (Declaration.all);
     516      Raise_Not_Implemented ("");
     517      return Nil_Element;
    402518   end Corresponding_Type_Declaration;
    403519
     
    411527      return Asis.Declaration
    412528   is
     529      pragma Unreferenced (The_Context);
    413530   begin
    414531      Check_Nil_Element (Declaration, "Corresponding_Type_Declaration");
    415       Check_Context (The_Context);
    416       return Corresponding_Type_Declaration (Declaration, The_Context.all);
     532--      Check_Context (The_Context);
     533      return Corresponding_Type_Declaration (Declaration);
    417534   end Corresponding_Type_Declaration;
    418535
     
    429546      Check_Nil_Element (Declaration, "Declaration_Subtype_Mark");
    430547
    431       case Declaration_Kind (Declaration.all) is
     548      case Asis.Elements.Declaration_Kind (Declaration) is
    432549         when A_Variable_Declaration |
    433550           A_Constant_Declaration |
     
    437554           A_Component_Declaration
    438555           =>
    439             Raise_Inappropriate_Element ("Declaration_Subtype_Mark");
     556--            Raise_Inappropriate_Element ("Declaration_Subtype_Mark");
     557            Raise_Not_Implemented ("");
     558            return Nil_Element;
    440559         when others =>
    441560            null;
    442561      end case;
    443562
    444       Result := Object_Declaration_Subtype (Declaration.all);
     563      Result := Object_Declaration_Subtype (Declaration);
    445564
    446565      if Assigned (Result) then
    447          case Definition_Kind (Result.all) is
     566         case Asis.Elements.Definition_Kind (Result) is
    448567            when A_Subtype_Indication =>
    449                return Get_Subtype_Mark (Result.all);
     568               Raise_Not_Implemented ("");
     569               return Nil_Element;
     570--               return Get_Subtype_Mark (Result.all);
    450571            when An_Access_Definition =>
    451                case Access_Definition_Kind (Result.all) is
     572               case Asis.Elements.Access_Definition_Kind (Result) is
    452573                  when An_Anonymous_Access_To_Object_Definition =>
    453                      return
    454                        Anonymous_Access_To_Object_Subtype_Mark (Result.all);
     574                     Raise_Not_Implemented ("");
     575                     return Nil_Element;
     576--                     return
     577--                       Anonymous_Access_To_Object_Subtype_Mark (Result.all);
    455578                  when others =>
    456                      raise Unimplemented;
     579                     Raise_Not_Implemented ("");
     580                     return Nil_Element;
    457581               end case;
    458582            when others =>
    459                raise Unimplemented;
     583               Raise_Not_Implemented ("");
     584               return Nil_Element;
    460585         end case;
    461586      end if;
     
    474599   begin
    475600      Check_Nil_Element (Defining_Name, "Defining_Name_Image");
    476       return Defining_Name_Image (Defining_Name.all);
     601      Raise_Not_Implemented ("");
     602      return "";
    477603   end Defining_Name_Image;
    478604
     
    487613   begin
    488614      Check_Nil_Element (Defining_Name, "Defining_Prefix");
    489       return Defining_Prefix (Defining_Name.all);
     615      Raise_Not_Implemented ("");
     616      return Nil_Element;
    490617   end Defining_Prefix;
    491618
     
    500627   begin
    501628      Check_Nil_Element (Defining_Name, "Defining_Selector");
    502       return Defining_Selector (Defining_Name.all);
     629      Raise_Not_Implemented ("");
     630      return Nil_Element;
    503631   end Defining_Selector;
    504632
     
    513641   begin
    514642      Check_Nil_Element (Declaration, "Discriminant_Part");
    515       return Discriminant_Part (Declaration.all);
     643      Raise_Not_Implemented ("");
     644      return Nil_Element;
    516645   end Discriminant_Part;
    517646
     
    526655   begin
    527656      Check_Nil_Element (Declaration, "Entry_Barrier");
    528       return Entry_Barrier (Declaration.all);
     657      Raise_Not_Implemented ("");
     658      return Nil_Element;
    529659   end Entry_Barrier;
    530660
     
    539669   begin
    540670      Check_Nil_Element (Declaration, "Entry_Family_Definition");
    541       return Entry_Family_Definition (Declaration.all);
     671      Raise_Not_Implemented ("");
     672      return Nil_Element;
    542673   end Entry_Family_Definition;
    543674
     
    552683   begin
    553684      Check_Nil_Element (Declaration, "Entry_Index_Specification");
    554       return Entry_Index_Specification (Declaration.all);
     685      Raise_Not_Implemented ("");
     686      return Nil_Element;
    555687   end Entry_Index_Specification;
    556688
     
    565697   begin
    566698      Check_Nil_Element (Declaration, "Formal_Subprogram_Default");
    567       return Formal_Subprogram_Default (Declaration.all);
     699      Raise_Not_Implemented ("");
     700      return Nil_Element;
    568701   end Formal_Subprogram_Default;
    569702
     
    580713      Check_Nil_Element (Declaration, "Generic_Actual_Part");
    581714      if Normalized then
    582          return Normalized_Generic_Actual_Part (Declaration.all);
     715         Raise_Not_Implemented ("");
     716         return Nil_Element_List;
    583717      else
    584          return Generic_Actual_Part (Declaration.all);
     718         Raise_Not_Implemented ("");
     719         return Nil_Element_List;
    585720      end if;
    586721   end Generic_Actual_Part;
     
    595730      return Asis.Element_List
    596731   is
     732      pragma Unreferenced (Include_Pragmas);
    597733   begin
    598734      Check_Nil_Element (Declaration, "Generic_Formal_Part");
    599       return Generic_Formal_Part (Declaration.all, Include_Pragmas);
     735      Raise_Not_Implemented ("");
     736      return Nil_Element_List;
    600737   end Generic_Formal_Part;
    601738
     
    610747   begin
    611748      Check_Nil_Element (Declaration, "Generic_Unit_Name");
    612       return Generic_Unit_Name (Declaration.all);
     749      Raise_Not_Implemented ("");
     750      return Nil_Element;
    613751   end Generic_Unit_Name;
    614752
     
    623761   begin
    624762      Check_Nil_Element (Declaration, "Initialization_Expression");
    625       return Initialization_Expression (Declaration.all);
     763      Raise_Not_Implemented ("");
     764      return Nil_Element;
    626765   end Initialization_Expression;
    627766
     
    636775   begin
    637776      Check_Nil_Element (Declaration, "Is_Dispatching_Operation");
    638       return Is_Dispatching_Operation (Declaration.all);
     777      Raise_Not_Implemented ("");
     778      return False;
    639779   end Is_Dispatching_Operation;
    640780
     
    649789   begin
    650790      Check_Nil_Element (Declaration, "Is_Name_Repeated");
    651       return Is_Name_Repeated (Declaration.all);
     791      Raise_Not_Implemented ("");
     792      return False;
    652793   end Is_Name_Repeated;
    653794
     
    662803   begin
    663804      Check_Nil_Element (Declaration, "Is_Private_Present");
    664       return Is_Private_Present (Declaration.all);
     805      Raise_Not_Implemented ("");
     806      return False;
    665807   end Is_Private_Present;
    666808
     
    671813   function Is_Subunit (Declaration : in Asis.Declaration) return Boolean is
    672814      Enclosing_Unit : constant Compilation_Unit :=
    673          Enclosing_Compilation_Unit (Declaration.all);
     815         Asis.Elements.Enclosing_Compilation_Unit (Declaration);
    674816   begin
    675817      if Assigned (Declaration) then
    676          return Is_Equal (Declaration, Unit_Declaration (Enclosing_Unit.all))
    677            and Unit_Kind (Enclosing_Unit.all) in A_Subunit;
     818         return Asis.Elements.Is_Equal
     819                  (Declaration,
     820                   Asis.Elements.Unit_Declaration (Enclosing_Unit))
     821           and Asis.Compilation_Units.Unit_Kind (Enclosing_Unit) in A_Subunit;
    678822      else
    679823         return False;
     
    691835   begin
    692836      Check_Nil_Element (Declaration, "Names");
    693       return Names (Declaration.all);
     837      Raise_Not_Implemented ("");
     838      return Nil_Element_List;
    694839   end Names;
    695840
     
    706851      Check_Nil_Element (Declaration, "Object_Declaration_View");
    707852
    708       case Declaration_Kind (Declaration.all) is
     853      case Asis.Elements.Declaration_Kind (Declaration) is
    709854         when A_Discriminant_Specification |
    710855           A_Parameter_Specification |
     
    712857           An_Object_Renaming_Declaration
    713858           =>
    714             Raise_Inappropriate_Element ("Object_Declaration_View");
     859--            Raise_Inappropriate_Element ("Object_Declaration_View");
     860            Raise_Not_Implemented ("");
     861            return Nil_Element;
    715862         when others =>
    716863            null;
    717864      end case;
    718865
    719       Result := Object_Declaration_Subtype (Declaration.all);
     866      Result := Object_Declaration_Subtype (Declaration);
    720867
    721868      if Assigned (Result) and then
    722         Definition_Kind (Result.all) = An_Access_Definition
     869        Asis.Elements.Definition_Kind (Result) = An_Access_Definition
    723870      then
    724         raise Unimplemented;
     871         Raise_Not_Implemented ("");
     872         return Nil_Element;
    725873      end if;
    726874
     
    737885   begin
    738886      Check_Nil_Element (Declaration, "Object_Declaration_Subtype");
    739       return Object_Declaration_Subtype (Declaration.all);
     887      Raise_Not_Implemented ("");
     888      return Nil_Element;
    740889   end Object_Declaration_Subtype;
    741890
     
    750899   begin
    751900      if Assigned (Declaration) then
    752          return Overriding_Indicator_Kind (Declaration.all);
     901         Raise_Not_Implemented ("");
     902         return Not_An_Overriding_Indicator;
    753903      else
    754904         return Not_An_Overriding_Indicator;
     
    766916   begin
    767917      Check_Nil_Element (Declaration, "Parameter_Profile");
    768       return Parameter_Profile (Declaration.all);
     918      Raise_Not_Implemented ("");
     919      return Nil_Element_List;
    769920   end Parameter_Profile;
    770921
     
    779930   begin
    780931      Check_Nil_Element (Defining_Name, "Position_Number_Image");
    781       return Position_Number_Image (Defining_Name.all);
     932      Raise_Not_Implemented ("");
     933      return "";
    782934   end Position_Number_Image;
    783935
     
    791943      return Asis.Declarative_Item_List
    792944   is
     945      pragma Unreferenced (Include_Pragmas);
    793946   begin
    794947      Check_Nil_Element (Declaration, "Private_Part_Declarative_Items");
    795       return Private_Part_Declarative_Items (Declaration.all, Include_Pragmas);
     948      Raise_Not_Implemented ("");
     949      return Nil_Element_List;
    796950   end Private_Part_Declarative_Items;
    797951
     
    805959   begin
    806960      Check_Nil_Element (Declaration, "Progenitor_List");
    807       return Progenitor_List (Declaration.all);
     961      Raise_Not_Implemented ("");
     962      return Nil_Element_List;
    808963   end Progenitor_List;
    809964
     
    817972      return Asis.Declaration_List
    818973   is
     974      pragma Unreferenced (Include_Pragmas);
    819975   begin
    820976      Check_Nil_Element (Declaration, "Protected_Operation_Items");
    821       return Protected_Operation_Items (Declaration.all, Include_Pragmas);
     977      Raise_Not_Implemented ("");
     978      return Nil_Element_List;
    822979   end Protected_Operation_Items;
    823980
     
    832989   begin
    833990      Check_Nil_Element (Declaration, "Renamed_Entity");
    834       return Renamed_Entity (Declaration.all);
     991      Raise_Not_Implemented ("");
     992      return Nil_Element;
    835993   end Renamed_Entity;
    836994
     
    8451003   begin
    8461004      Check_Nil_Element (Defining_Name, "Representation_Value_Image");
    847       return Representation_Value_Image (Defining_Name.all);
     1005      Raise_Not_Implemented ("");
     1006      return "";
    8481007   end Representation_Value_Image;
    8491008
     
    8591018   begin
    8601019      Check_Nil_Element (Declaration, "Result_Profile");
    861       Result := Result_Subtype (Declaration.all);
     1020--      Result := Result_Subtype (Declaration);
    8621021
    8631022      if Assigned (Result) then
    864          case Definition_Kind (Result.all) is
     1023         case Asis.Elements.Definition_Kind (Result) is
    8651024            when A_Subtype_Indication =>
    866                return Get_Subtype_Mark (Result.all);
     1025               Raise_Not_Implemented ("");
     1026               return Nil_Element;
     1027--               return Asis.Definitions.Subtype_Mark (Result);
    8671028            when others =>
    868                raise Unimplemented;
     1029               Raise_Not_Implemented ("");
     1030               return Nil_Element;
    8691031         end case;
    8701032      end if;
     
    8821044   begin
    8831045      Check_Nil_Element (Declaration, "Result_Subtype");
    884       return Result_Subtype (Declaration.all);
     1046      Raise_Not_Implemented ("");
     1047      return Nil_Element;
    8851048   end Result_Subtype;
    8861049
     
    8951058   begin
    8961059      Check_Nil_Element (Specification, "Specification_Subtype_Definition");
    897       return Specification_Subtype_Definition (Specification.all);
     1060      Raise_Not_Implemented ("");
     1061      return Nil_Element;
    8981062   end Specification_Subtype_Definition;
    8991063
     
    9081072   begin
    9091073      Check_Nil_Element (Declaration, "Type_Declaration_View");
    910       return Type_Declaration_View (Declaration.all);
     1074      Raise_Not_Implemented ("");
     1075      return Nil_Element;
    9111076   end Type_Declaration_View;
    9121077
     
    9201085      return Asis.Declarative_Item_List
    9211086   is
     1087      pragma Unreferenced (Include_Pragmas);
    9221088   begin
    9231089      Check_Nil_Element (Declaration, "Visible_Part_Declarative_Items");
    924       return Visible_Part_Declarative_Items (Declaration.all, Include_Pragmas);
     1090      Raise_Not_Implemented ("");
     1091      return Nil_Element_List;
    9251092   end Visible_Part_Declarative_Items;
    9261093
  • trunk/ada-2012/src/asis/asis-declarations.ads

    r318 r320  
    1818-------------------------------------------------------------------------------
    1919-------------------------------------------------------------------------------
    20 -- 15 package Asis.Declarations
     20--  15 package Asis.Declarations
    2121-------------------------------------------------------------------------------
    2222-------------------------------------------------------------------------------
    2323
    2424package Asis.Declarations is
    25    pragma Preelaborate;
     25--   pragma Preelaborate;
    2626
    2727-------------------------------------------------------------------------------
  • trunk/ada-2012/src/asis/asis-extensions-flat_kinds.adb

    r258 r320  
    998998   overriding procedure Procedure_Body
    999999     (Self : in out Visiter;
    1000       Node : not null Gela.Elements.Procedure_Bodies.Procedure_Body_Access)
    1001    is null;
     1000      Node : not null Gela.Elements.Procedure_Bodies.Procedure_Body_Access);
    10021001
    10031002   overriding procedure Procedure_Call_Statement
    10041003     (Self : in out Visiter;
    10051004      Node : not null Gela.Elements.Procedure_Call_Statements.
    1006         Procedure_Call_Statement_Access)
    1007    is null;
     1005        Procedure_Call_Statement_Access);
    10081006
    10091007   overriding procedure Procedure_Declaration
     
    12961294   end Flat_Kind;
    12971295
     1296   --------------------
     1297   -- Procedure_Body --
     1298   --------------------
     1299
     1300   overriding procedure Procedure_Body
     1301     (Self : in out Visiter;
     1302      Node : not null Gela.Elements.Procedure_Bodies.Procedure_Body_Access)
     1303   is
     1304      pragma Unreferenced (Node);
     1305   begin
     1306      Self.Result := A_Procedure_Body_Declaration;
     1307   end Procedure_Body;
     1308
     1309   ------------------------------
     1310   -- Procedure_Call_Statement --
     1311   ------------------------------
     1312
     1313   overriding procedure Procedure_Call_Statement
     1314     (Self : in out Visiter;
     1315      Node : not null Gela.Elements.Procedure_Call_Statements.
     1316        Procedure_Call_Statement_Access)
     1317   is
     1318      pragma Unreferenced (Node);
     1319   begin
     1320      Self.Result := A_Procedure_Call_Statement;
     1321   end Procedure_Call_Statement;
     1322
    12981323   ------------------------
    12991324   -- Selected_Component --
  • trunk/ada-2012/src/asis/asis-statements.adb

    r318 r320  
    1010--  Procedural wrapper over Object-Oriented ASIS implementation
    1111
     12with Gela.Element_Visiters;
     13with Gela.Elements.Names;
     14with Gela.Elements.Function_Calls;
     15with Gela.Elements.Prefixes;
     16with Gela.Elements.Procedure_Call_Statements;
     17
    1218package body Asis.Statements is
    1319
     
    2228   begin
    2329      Check_Nil_Element (Statement, "Aborted_Tasks");
    24       return Aborted_Tasks (Statement.all);
     30      Raise_Not_Implemented ("");
     31      return Asis.Nil_Element_List;
    2532   end Aborted_Tasks;
    2633
     
    3441      return Asis.Statement_List
    3542   is
     43      pragma Unreferenced (Include_Pragmas);
    3644   begin
    3745      Check_Nil_Element (Statement, "Accept_Body_Exception_Handlers");
    38       return Accept_Body_Exception_Handlers (Statement.all, Include_Pragmas);
     46      Raise_Not_Implemented ("");
     47      return Asis.Nil_Element_List;
    3948   end Accept_Body_Exception_Handlers;
    4049
     
    4857      return Asis.Statement_List
    4958   is
     59      pragma Unreferenced (Include_Pragmas);
    5060   begin
    5161      Check_Nil_Element (Statement, "Accept_Body_Statements");
    52       return Accept_Body_Statements (Statement.all, Include_Pragmas);
     62      Raise_Not_Implemented ("");
     63      return Asis.Nil_Element_List;
    5364   end Accept_Body_Statements;
    5465
     
    6374   begin
    6475      Check_Nil_Element (Statement, "Accept_Entry_Direct_Name");
    65       return Accept_Entry_Direct_Name (Statement.all);
     76      Raise_Not_Implemented ("");
     77      return Asis.Nil_Element;
    6678   end Accept_Entry_Direct_Name;
    6779
     
    7688   begin
    7789      Check_Nil_Element (Statement, "Accept_Entry_Index");
    78       return Accept_Entry_Index (Statement.all);
     90      Raise_Not_Implemented ("");
     91      return Asis.Nil_Element;
    7992   end Accept_Entry_Index;
    8093
     
    89102   begin
    90103      Check_Nil_Element (Statement, "Accept_Parameters");
    91       return Accept_Parameters (Statement.all);
     104      Raise_Not_Implemented ("");
     105      return Asis.Nil_Element_List;
    92106   end Accept_Parameters;
    93107
     
    102116   begin
    103117      Check_Nil_Element (Statement, "Assignment_Expression");
    104       return Assignment_Expression (Statement.all);
     118      Raise_Not_Implemented ("");
     119      return Asis.Nil_Element;
    105120   end Assignment_Expression;
    106121
     
    115130   begin
    116131      Check_Nil_Element (Statement, "Assignment_Variable_Name");
    117       return Assignment_Variable_Name (Statement.all);
     132      Raise_Not_Implemented ("");
     133      return Asis.Nil_Element;
    118134   end Assignment_Variable_Name;
    119135
     
    127143      return Asis.Declarative_Item_List
    128144   is
     145      pragma Unreferenced (Include_Pragmas);
    129146   begin
    130147      Check_Nil_Element (Statement, "Block_Declarative_Items");
    131       return Block_Declarative_Items (Statement.all, Include_Pragmas);
     148      Raise_Not_Implemented ("");
     149      return Asis.Nil_Element_List;
    132150   end Block_Declarative_Items;
    133151
     
    141159      return Asis.Exception_Handler_List
    142160   is
     161      pragma Unreferenced (Include_Pragmas);
    143162   begin
    144163      Check_Nil_Element (Statement, "Block_Exception_Handlers");
    145       return Block_Exception_Handlers (Statement.all, Include_Pragmas);
     164      Raise_Not_Implemented ("");
     165      return Asis.Nil_Element_List;
    146166   end Block_Exception_Handlers;
    147167
     
    155175      return Asis.Statement_List
    156176   is
     177      pragma Unreferenced (Include_Pragmas);
    157178   begin
    158179      Check_Nil_Element (Statement, "Block_Statements");
    159       return Block_Statements (Statement.all, Include_Pragmas);
     180      Raise_Not_Implemented ("");
     181      return Asis.Nil_Element_List;
    160182   end Block_Statements;
    161183
     
    172194      Check_Nil_Element (Statement, "Call_Statement_Parameters");
    173195      if Normalized then
    174          return Normalized_Call_Statement_Parameters (Statement.all);
     196         Raise_Not_Implemented ("");
     197         return Asis.Nil_Element_List;
    175198      else
    176          return Call_Statement_Parameters (Statement.all);
     199         Raise_Not_Implemented ("");
     200         return Asis.Nil_Element_List;
    177201      end if;
    178202   end Call_Statement_Parameters;
     
    186210      return Asis.Expression
    187211   is
     212      package Get is
     213         type Visiter is new Gela.Element_Visiters.Visiter with record
     214            Found  : Boolean := True;
     215            Result : Gela.Elements.Element_Access;
     216         end record;
     217
     218         overriding procedure Function_Call
     219           (Self : in out Visiter;
     220            Node : not null Gela.Elements.Function_Calls.Function_Call_Access);
     221
     222         overriding procedure Procedure_Call_Statement
     223           (Self : in out Visiter;
     224            Node : not null Gela.Elements.Procedure_Call_Statements.
     225              Procedure_Call_Statement_Access);
     226
     227      end Get;
     228
     229      package body Get is
     230
     231         overriding procedure Procedure_Call_Statement
     232           (Self : in out Visiter;
     233            Node : not null Gela.Elements.Procedure_Call_Statements.
     234              Procedure_Call_Statement_Access)
     235         is
     236            Prefix : constant Gela.Elements.Names.Name_Access :=
     237              Node.Called_Name;
     238         begin
     239            Prefix.Visit (Self);
     240
     241            if not Self.Found then
     242               Self.Result := Gela.Elements.Element_Access (Prefix);
     243            end if;
     244         end Procedure_Call_Statement;
     245
     246         overriding procedure Function_Call
     247           (Self : in out Visiter;
     248            Node : not null Gela.Elements.Function_Calls.Function_Call_Access)
     249         is
     250            Prefix : constant Gela.Elements.Prefixes.Prefix_Access :=
     251              Node.Prefix;
     252         begin
     253            Self.Result := Gela.Elements.Element_Access (Prefix);
     254            Self.Found := True;
     255         end Function_Call;
     256
     257      end Get;
     258
     259      V : Get.Visiter;
    188260   begin
    189261      Check_Nil_Element (Statement, "Called_Name");
    190       return Called_Name (Statement.all);
     262      Statement.Data.Visit (V);
     263      return (Data => V.Result);
    191264   end Called_Name;
    192265
     
    201274   begin
    202275      Check_Nil_Element (Statement, "Case_Expression");
    203       return Case_Expression (Statement.all);
     276      Raise_Not_Implemented ("");
     277      return Asis.Nil_Element;
    204278   end Case_Expression;
    205279
     
    214288   begin
    215289      Check_Nil_Element (Path, "Case_Statement_Alternative_Choices");
    216       return Case_Statement_Alternative_Choices (Path.all);
     290      Raise_Not_Implemented ("");
     291      return Asis.Nil_Element_List;
    217292   end Case_Statement_Alternative_Choices;
    218293
     
    227302   begin
    228303      Check_Nil_Element (Handler, "Choice_Parameter_Specification");
    229       return Choice_Parameter_Specification (Handler.all);
     304      Raise_Not_Implemented ("");
     305      return Asis.Nil_Element;
    230306   end Choice_Parameter_Specification;
    231307
     
    240316   begin
    241317      Check_Nil_Element (Path, "Condition_Expression");
    242       return Condition_Expression (Path.all);
     318      Raise_Not_Implemented ("");
     319      return Asis.Nil_Element;
    243320   end Condition_Expression;
    244321
     
    253330   begin
    254331      Check_Nil_Element (Statement, "Corresponding_Called_Entity");
    255       return Corresponding_Called_Entity (Statement.all);
     332      Raise_Not_Implemented ("");
     333      return Asis.Nil_Element;
    256334   end Corresponding_Called_Entity;
    257335
     
    266344   begin
    267345      Check_Nil_Element (Statement, "Corresponding_Destination_Statement");
    268       return Corresponding_Destination_Statement (Statement.all);
     346      Raise_Not_Implemented ("");
     347      return Asis.Nil_Element;
    269348   end Corresponding_Destination_Statement;
    270349
     
    279358   begin
    280359      Check_Nil_Element (Statement, "Corresponding_Entry");
    281       return Corresponding_Entry (Statement.all);
     360      Raise_Not_Implemented ("");
     361      return Asis.Nil_Element;
    282362   end Corresponding_Entry;
    283363
     
    292372   begin
    293373      Check_Nil_Element (Statement, "Corresponding_Loop_Exited");
    294       return Corresponding_Loop_Exited (Statement.all);
     374      Raise_Not_Implemented ("");
     375      return Asis.Nil_Element;
    295376   end Corresponding_Loop_Exited;
    296377
     
    305386   begin
    306387      Check_Nil_Element (Statement, "Delay_Expression");
    307       return Delay_Expression (Statement.all);
     388      Raise_Not_Implemented ("");
     389      return Asis.Nil_Element;
    308390   end Delay_Expression;
    309391
     
    318400   begin
    319401      Check_Nil_Element (Handler, "Exception_Choices");
    320       return Exception_Choices (Handler.all);
     402      Raise_Not_Implemented ("");
     403      return Asis.Nil_Element_List;
    321404   end Exception_Choices;
    322405
     
    331414   begin
    332415      Check_Nil_Element (Statement, "Exit_Condition");
    333       return Exit_Condition (Statement.all);
     416      Raise_Not_Implemented ("");
     417      return Asis.Nil_Element;
    334418   end Exit_Condition;
    335419
     
    344428   begin
    345429      Check_Nil_Element (Statement, "Exit_Loop_Name");
    346       return Exit_Loop_Name (Statement.all);
     430      Raise_Not_Implemented ("");
     431      return Asis.Nil_Element;
    347432   end Exit_Loop_Name;
    348433
     
    356441      return Asis.Exception_Handler_List
    357442   is
     443      pragma Unreferenced (Include_Pragmas);
    358444   begin
    359445      Check_Nil_Element (Statement, "Extended_Return_Exception_Handlers");
    360       return Extended_Return_Exception_Handlers (Statement.all,
    361                                                  Include_Pragmas);
     446      Raise_Not_Implemented ("");
     447      return Asis.Nil_Element_List;
    362448   end Extended_Return_Exception_Handlers;
    363449
     
    371457      return Asis.Statement_List
    372458   is
     459      pragma Unreferenced (Include_Pragmas);
    373460   begin
    374461      Check_Nil_Element (Statement, "Extended_Return_Statements");
    375       return Extended_Return_Statements (Statement.all, Include_Pragmas);
     462      Raise_Not_Implemented ("");
     463      return Asis.Nil_Element_List;
    376464   end Extended_Return_Statements;
    377465
     
    386474   begin
    387475      Check_Nil_Element (Statement, "For_Loop_Parameter_Specification");
    388       return Loop_Parameter_Specification (Statement.all);
     476      Raise_Not_Implemented ("");
     477      return Asis.Nil_Element;
    389478   end For_Loop_Parameter_Specification;
    390479
     
    399488   begin
    400489      Check_Nil_Element (Statement, "Goto_Label");
    401       return Goto_Label (Statement.all);
     490      Raise_Not_Implemented ("");
     491      return Asis.Nil_Element;
    402492   end Goto_Label;
    403493
     
    412502   begin
    413503      Check_Nil_Element (Path, "Guard");
    414       return Guard (Path.all);
     504      Raise_Not_Implemented ("");
     505      return Asis.Nil_Element;
    415506   end Guard;
    416507
     
    424515      return Asis.Statement_List
    425516   is
     517      pragma Unreferenced (Include_Pragmas);
    426518   begin
    427519      Check_Nil_Element (Handler, "Handler_Statements");
    428       return Handler_Statements (Handler.all, Include_Pragmas);
     520      Raise_Not_Implemented ("");
     521      return Asis.Nil_Element_List;
    429522   end Handler_Statements;
    430523
     
    439532   begin
    440533      Check_Nil_Element (Call, "Is_Call_On_Dispatching_Operation");
    441       return Is_Call_On_Dispatching_Operation (Call.all);
     534      Raise_Not_Implemented ("");
     535      return False;
    442536   end Is_Call_On_Dispatching_Operation;
    443537
     
    452546   begin
    453547      Check_Nil_Element (Statement, "Is_Declare_Block");
    454       return Is_Declare_Block (Statement.all);
     548      Raise_Not_Implemented ("");
     549      return False;
    455550   end Is_Declare_Block;
    456551
     
    462557   begin
    463558      Check_Nil_Element (Call, "Is_Dispatching_Call");
    464       return Is_Dispatching_Call (Call.all);
     559      Raise_Not_Implemented ("");
     560      return False;
    465561   end Is_Dispatching_Call;
    466562
     
    475571   begin
    476572      Check_Nil_Element (Statement, "Is_Name_Repeated");
    477       return Is_Name_Repeated (Statement.all);
     573      Raise_Not_Implemented ("");
     574      return False;
    478575   end Is_Name_Repeated;
    479576
     
    488585   begin
    489586      Check_Nil_Element (Statement, "Label_Names");
    490       return Label_Names (Statement.all);
     587      Raise_Not_Implemented ("");
     588      return Asis.Nil_Element_List;
    491589   end Label_Names;
    492590
     
    500598      return Asis.Statement_List
    501599   is
     600      pragma Unreferenced (Include_Pragmas);
    502601   begin
    503602      Check_Nil_Element (Statement, "Loop_Statements");
    504       return Loop_Statements (Statement.all, Include_Pragmas);
     603      Raise_Not_Implemented ("");
     604      return Asis.Nil_Element_List;
    505605   end Loop_Statements;
    506606
     
    515615   begin
    516616      Check_Nil_Element (Statement, "Qualified_Expression");
    517       return Qualified_Expression (Statement.all);
     617      Raise_Not_Implemented ("");
     618      return Asis.Nil_Element;
    518619   end Qualified_Expression;
    519620
     
    528629   begin
    529630      Check_Nil_Element (Statement, "Raised_Exception");
    530       return Raised_Exception (Statement.all);
     631      Raise_Not_Implemented ("");
     632      return Asis.Nil_Element;
    531633   end Raised_Exception;
    532634
     
    540642   begin
    541643      Check_Nil_Element (Statement, "Raise_Statement_Message");
    542       return Raise_Statement_Message (Statement.all);
     644      Raise_Not_Implemented ("");
     645      return Asis.Nil_Element;
    543646   end Raise_Statement_Message;
    544647
     
    553656   begin
    554657      Check_Nil_Element (Statement, "Requeue_Entry_Name");
    555       return Requeue_Entry_Name (Statement.all);
     658      Raise_Not_Implemented ("");
     659      return Asis.Nil_Element;
    556660   end Requeue_Entry_Name;
    557661
     
    566670   begin
    567671      Check_Nil_Element (Statement, "Return_Expression");
    568       return Return_Expression (Statement.all);
     672      Raise_Not_Implemented ("");
     673      return Asis.Nil_Element;
    569674   end Return_Expression;
    570675
     
    579684   begin
    580685      Check_Nil_Element (Statement, "Return_Object_Specification");
    581       return Return_Object_Specification (Statement.all);
     686      Raise_Not_Implemented ("");
     687      return Asis.Nil_Element;
    582688   end Return_Object_Specification;
    583689
     
    591697      return Asis.Statement_List
    592698   is
     699      pragma Unreferenced (Include_Pragmas);
    593700   begin
    594701      Check_Nil_Element (Path, "Sequence_Of_Statements");
    595       return Sequence_Of_Statements (Path.all, Include_Pragmas);
     702      Raise_Not_Implemented ("");
     703      return Asis.Nil_Element_List;
    596704   end Sequence_Of_Statements;
    597705
     
    606714   begin
    607715      Check_Nil_Element (Statement, "Statement_Identifier");
    608       return Statement_Identifier (Statement.all);
     716      Raise_Not_Implemented ("");
     717      return Asis.Nil_Element;
    609718   end Statement_Identifier;
    610719
     
    618727      return Asis.Path_List
    619728   is
     729      pragma Unreferenced (Include_Pragmas);
    620730   begin
    621731      Check_Nil_Element (Statement, "Statement_Paths");
    622       return Statement_Paths (Statement.all, Include_Pragmas);
     732      Raise_Not_Implemented ("");
     733      return Asis.Nil_Element_List;
    623734   end Statement_Paths;
    624735
     
    633744   begin
    634745      Check_Nil_Element (Statement, "While_Condition");
    635       return While_Condition (Statement.all);
     746      Raise_Not_Implemented ("");
     747      return Asis.Nil_Element;
    636748   end While_Condition;
    637749
  • trunk/ada-2012/src/asis/asis.ads

    r258 r320  
    915915                                                   --                 function
    916916
    917    subtype An_Anonymous_Access_to_Object_Definition is Access_Definition_Kinds
     917   subtype An_Anonymous_Access_To_Object_Definition is Access_Definition_Kinds
    918918      range An_Anonymous_Access_To_Variable .. An_Anonymous_Access_To_Constant;
    919919
Note: See TracChangeset for help on using the changeset viewer.