!ASIS Issue #022 !topic Normalize associations list !reference ASIS95 !from Sergey Rybin and Steve Blake 96-11-06 !keywords association list normalized component parameter !discussion There are two queries in ASIS95 for obtaining the association list from a subprogram or entry call - Asis.Expressions.Function_Call_Parameters for functions and Asis.Statements.Call_Statement_Parameters for procedures and entries. Both these queries have the Normalized parameter. The problem is that a function call may be a call to an attribute-function (such as P'Pred (X) or T'Max (Y,Z),and a procedure call may be a call to a attribute-procedure (such as T'Read (Var)), and the existing documentation of these two queries does not cover situations, when a call being decomposed is the call to attribute-subprogram, and the Normalized parameter is set True. Ada does not allow the positional associations for calls to functions-attributes. I failed to find any place where it is said explicitly, but function-attributes have no declarations (neither explicit nor implicit), so there cannot be any visible declarations for any formal parameter name from such a call. The questions are: - should ASIS allow obtaining normalized component list from a call to attribute-function? - if it should, what is a normalized parameter association for a call to attribute-function? Our suggestion is: 1. Calls with the Normalized parameter set True should be allowed for all function calls and procedure calls, including cases when the called entity is an attribute. (It does not make any formal contradiction with Ada, because normalized associations are entirely ASIS internal notion.) Another solution may be to raise Asis_Inappropriate_Element, but it would have at least two disadvantagies - first, it would change the existing semantics of these queries, second, it would force an application to use additional exception handlers to deal with possible exceptions. 2. Normalised associations obtained from calls to attributes-subprograms should test Is_Normalized, it could never be Is_Defaulted_Association. 3. When further decomposed, a Normalised association obtained from a call to an attributes-subprogram should yield Nil_Element as a formal parameter (a result of Asis.Expressions.Formal_Parameter. The corresponding statements should be added to the documentation of Asis.Expressions.Function_Call_Parameters, Asis.Statements.Call_Statement_Parameters and Asis.Expressions.Formal_Parameter. !resolution Accepted, with Modification. !date 96-12-03 !Notes Additional commentary has been added to some of the interfaces. Some clean-up was also performed. These appeared in ASIS version 2.0.K.