!ASIS Issue #095 !topic Semantic queries for multi-part declarations !reference ASIS 95 !from Sergey Rybin 98-05-15 !keywords semantic queries declarations multi-part !discussion Consider the following example: package Pkg1 is procedure Foo ( A: in out integer ); ^^^ <----------------- ???? <--------- end Pkg1; | | package body Pkg1 is | | procedure Foo ( A: in out integer ) is | begin ^^^ <------------------ ???? <------- A := 5; | ^^^ >-----------> Corresponding_Name_Definition >--> end Foo; end Pkg1; Which definition of the formal parameter A should be returned by Corresponding_Name_Definition when applying to usage occurence of A in an assignment statement? This is not clarified now in the ASIS definition, and this makes a problem for tools - what should a tool expect in this case? (My message just originates from a real problem of this kind) I think ASIS should clarify this. Note, that what is presented above is only an example. The same problem exists for Corresponding_Called_Function in case if a separate spec exists along with the body for a given function. !resolution Accept. !date 98-07-29 Proposed Resolution: To Clause 17.6, Corresponding_Name_Definition in the Implementation Permissions commentary; Clause 17.29, Corresponding_Called_Function in the Implementation Permissions commentary; and Clause 18.25, Corresponding_Called_Entity after the Returns Declaration_Kinds list; add the following text: --|IP An implementation may choose to return any part of multi-part --|IP declarations and definitions. Multi-part declaration/definitions --|IP can occur for: --|IP --|IP - Subprogram specification in package specification, package body, --|IP and subunits (is separate); --|IP - Entries in package specification, package body, and subunits --|IP (is separate); --|IP - Private type and full type declarations; --|IP - Incomplete type and full type declarations; and --|IP - Deferred constant and full constant declarations. --|IP --|IP No guarantee is made that the element will be the first part or --|IP that the determination will be made due to any visibility rules. --|IP An application should make its own analysis for each case based --|IP on which part is returned.