!ASIS Issue #078 !topic Corresponding_Base_Entity !reference ASIS 95-15.35 !from Sergey Rybin 97-05-11 !keywords Corresponding_Base_Entity !discussion How, do you think, what should be returned by Asis.Declarations.Coresponding_Base_Entity in the following situation: procedure Renaming is type Rec1 is record I : Integer; end record; type Rec2 is record C : Rec1; end record; type Rec3 is record Comp : Rec2; end record; X : Rec3; Y : Rec3 renames X; Var1 : Rec2 renames Y.Comp; Var2 : Rec1 renames Var1.C; Var3 : Integer renames Var2.I; -- << this is the declaration of interst begin Var3 := 13; end Renaming; ASIS definition defines this query as follows: -------------------------------------------- -- Section 15.35 function Coresponding_Base_Entity -------------------------------------------- function Coresponding_Base_Entity (Declaration : in Asis.Declaration) return Asis.Expresion; -------------------------------------------- -- Declaration - Specifies the rename declaration to query -- -- Unwinds recursive renamings to return the expresion used to name -- the first renamed entity that is not itself a renamed entity. This -- expresion is the name expresion found in the last RENAME declaration -- when folowing a chain of sucesive renaming declarations. -- -- ... But for the example above no name corresponding to the last renaming of Var2.I can be found in any of the previous renamings. So, as we can see, if in a renaming chain is some renaming of a *component* of some *previously renamed* (record) object, we have a hole in the ASIS semantics. Any comments? !resolution Accept, with Modifications. !date 97-05-28 !Notes function Corresponding_Base_Entity (Declaration : in Asis.Declaration) return Asis.Expression; --------------------------------------------------------------------------------------- -- Declaration - Specifies the rename declaration to query -- -- The base entity is defined to be the renamed entity that is not itself -- defined by another renaming declaration. -- -- If the name following the reserved word "renames" is itself declared by a -- previous renaming_declaration, then this query unwinds the renamings by -- recursively operating on the previous renaming_declaration. -- -- Otherwise, the name following the reserved word "renames" is returned. -- -- Appropriate Declaration_Kinds: -- An_Object_Renaming_Declaration -- An_Exception_Renaming_Declaration -- A_Procedure_Renaming_Declaration -- A_Function_Renaming_Declaration -- A_Package_Renaming_Declaration -- A_Generic_Package_Renaming_Declaration -- A_Generic_Procedure_Renaming_Declaration -- A_Generic_Function_Renaming_Declaration -- -- Returns Element_Kinds: -- An_Expression Changes were made to ASIS version 2.0.N.