Changeset 2567

Show
Ignore:
Timestamp:
12/04/07 10:29:12 (1 year ago)
Author:
maxr
Message:

ada-2005: part of name resolution rule 4.5.2(9.1/2)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ada-2005/tendra/src/producers/ada/asis/asis-gela-overloads-walk-up.adb

    r2563 r2567  
    11841184      end Check_Slice_Index; 
    11851185 
     1186      ---------------------------- 
     1187      -- Is_Universal_Access_Eq -- 
     1188      ---------------------------- 
     1189 
     1190      function Is_Universal_Access_Eq (Op : Asis.Declaration) return Boolean is 
     1191         Name : constant Asis.Defining_Name := Asis.Declarations.Names (Op)(1); 
     1192         Tipe : Asis.Definition; 
     1193         Decl : Asis.Declaration; 
     1194      begin 
     1195         if Defining_Name_Kind (Name) = A_Defining_Operator_Symbol and then 
     1196           Is_Part_Of_Implicit (Op) 
     1197         then 
     1198            Tipe := Asis.Declarations.Corresponding_Type (Op); 
     1199            Decl := Enclosing_Element (Tipe); 
     1200 
     1201            return Is_Equal (Decl, XASIS.Types.Universal_Access); 
     1202         end if; 
     1203 
     1204         return False; 
     1205      end Is_Universal_Access_Eq; 
     1206 
     1207      function Check_Universal_Access_Eq  --  ARM 4.5.2 (9.1/2) 
     1208        (Name : Up_Interpretation) return Boolean 
     1209      is 
     1210      begin 
     1211         if Name.Kind /= A_Declaration or else 
     1212           not Is_Universal_Access_Eq (Name.Declaration) 
     1213         then 
     1214            return True; 
     1215         end if; 
     1216 
     1217         if not Is_Anonymous_Access (Stored.Real_Types (1)) 
     1218           and then not Is_Anonymous_Access (Stored.Real_Types (2)) 
     1219         then 
     1220            return False; 
     1221         end if; 
     1222 
     1223         if Is_Expanded_Name (Asis.Expressions.Prefix (Element)) then 
     1224            return True; 
     1225         end if; 
     1226 
     1227         --  TODO rest of rule 
     1228         return True; 
     1229      end Check_Universal_Access_Eq; 
     1230 
    11861231   begin  --  Up_Function_Call 
    11871232      for I in reverse Sets'Range loop 
     
    11981243         Get (Names, I, Name); 
    11991244 
    1200          if Check_Name (Name) and then Check_Parameters (Get_Profile (Name)) 
     1245         if Check_Name (Name) 
     1246           and then Check_Parameters (Get_Profile (Name)) 
     1247           and then Check_Universal_Access_Eq (Name) 
    12011248         then 
    12021249            Tipe := Get_Result_Profile (Name, Element);