VHDL Issue Number: 1086 Classification: Language Definition Problem Language Version: VHDL-93 Summary: Use of character literal or operator symbol in alias Related Issues: ? Relevant LRM Sections: 4.3.4, 2.3.1 Key Words and Phrases: alias, operator symbol, character literal, overloading Current Status: ISAC-Approved 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1994/03/22 Author of Submission: Anne Robert Author's Affiliation: LEDA S.A. Author's Post Address: 35 Av du Granier 38240 MEYLAN FRANCE Author's Phone Number: (+33) 76 41 92 43 Author's Fax Number: (+33) 76 41 92 44 Author's Net Address: anne@leda.fr ----------------------- Date Analyzed: 1997/06/25 Author of Analysis: Dale Martin Peter Ashenden Revision Number: $Revision: 1.1 $ Date Last Revised: $Date: 1995/07/25 18:37:19 $ Description of Problem ---------------------- No restrictions have been made on the use of a character literal or operator symbol as the designator of an alias. For example, according to the LRM, it is legal to use a character literal to alias an object or a function. Proposed Resolution ------------------- + A character literal can be used to alias the designator of an enumeration literal only. + An operator symbol can be used only as the alias designator of a function whose parameter and result type profile match operator profile requirements. VASG-ISAC Analysis & Rationale ------------------------------ As the issue author notes, the syntax rule for an alias declaration allows the alias designator to be an operator symbol or a character literal. The VHDL-93 LRM does not explicitly restrict the class of object or entity that may be aliased with an operator symbol or a character literal. There are some implicit restrictions that arise from the syntactic contexts in which an operator symbol or a character literal can otherwise be written. For example, a character literal can not occur as a type_mark, so aliasing a type name with a character literal is useless. Similarly, aliasing a binary operator symbol to a function with only one parameter would not be sufficient to allow unary use of the operator. The resolution proposed by the issue author is not sufficient to prevent significant obfuscation in a model. For example, the following alias: alias 'a' is std.standard.'b' [ return std.standard.character ]; would still be legal under the proposed resolution, and would make the expression 'a' = 'b' have the value true! However, the proposed resolution makes the intention of operator symbol and enumeration literal alias designators clear, and is thus desirable. It would, for example, make the following illegal: constant c : integer := 1; alias 'c' is c; which would otherwise make the expression 'c' = 1 have the value true. VASG-ISAC Recommendation for IEEE Std 1076-1993 ----------------------------------------------- If the alias designator is a character literal, the name must denote an enumeration literal. If the alias designator is an operator symbol, the name must denote a function, and that function then overloads the operator symbol. The operator symbol and the function must meet the requirements of 2.3.1. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- In 4.3.3, add the following paragraph after line 549: If the alias designator is a character literal, the name must denote an enumeration literal. If the alias designator is an operator symbol, the name must denote a function, and that function then overloads the operator symbol. The operator symbol and the function must meet the requirements of 2.3.1.