VHDL Issue Number: 0098 Classification: Language Definition Problem Language Version: VHDL-87 Summary: What is a "one-dimensional character array type"? Related Issues: None. Relevant LRM Sections: 3.1.1, 7.3.1, 7.3.2.2, 8.7 Key Words and Phrases: one-dimensional character array type, case statement Current Status: Submitted 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: Proposed resolution adopted in section 8.8 of VHDL93 Superseded By: N/A ----------------------- Date Submitted: 1991/01/29 Author of Submission: Paul Menchini Author's Affiliation: CAD Language Systems, Inc. Author's Post Address: P.O. Box 13036 Research Triangle Park, NC 27709-3036 Author's Phone Number: (919) 361-1913 Author's Fax Number: Author's Net Address: mench@clsi.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.7 $ Date Last Revised: $Date: 1995/05/13 19:34:42 $ Description of Problem ---------------------- The first sentence of paragraph 2 of Section 8.7 of the LRM (page 8-8) reads: The expression must be of a discrete type, or of a one-dimensional character array type (whose values are representable as string or bit string literals). What does the parenthetical comment "whose values are representable as string or bit string literals" mean? And what is its significance? Is the comment intended to provide additional restrictions on the permissible types of selector expressions in case statements, or is it merely restating of the definition of "one-dimensional character array type"? The term "one-dimensional character array type" is not defined in the LRM; however, per Section 7.3.1, String and bit string literals are representations of one- dimensional arrays of characters. The type of a string or bit string literal must be determinable solely from the context in which the literal appears, excluding the literal itself, but using the fact that the type of the literal must be a one- dimensional array of a character type (for string literals) or of type BIT (for bit string literals). and, per Section 7.3.2.2, A string or bit string literal is allowed in a multi-dimensional aggregate at the place of a one-dimensional array of a character type. Note that, per LRM Section 3.1.1, an enumeration type is also a character type "if at least one of its enumeration literals is a character literal." Thus, it seems that a one-dimensional character array type is a one-dimensional array whose element type is a character type. Furthermore, it seems reasonable to conclude that string literals and bit string literals are the literals of one-dimensional character array types. Note that, by these assumptions, both Std.Standard.Bit_Vector and Std.Standard. String are one-dimensional character array types. Furthermore, while *all* values of type Bit_Vector are representable as string literals and bit string literals, (because the type Std.Standard.Character contains non-character literals) not all values of String are representable as string literals. At this point, I can now state the issue precisely with the following questions: 1. What is a "one-dimensional character array type"? Is it a. a one-dimensional array whose element base type is a character type? Or, is it b. a one-dimensional array whose element base type is an enumeration type consisting solely of character literals? 2. If the answer to question 1 is "a", what is the significance of the parenthetical expression quoted at the beginning of this discussion? Does it mean a. that if the base type of the selector expression is a one- dimensional character array, that all of the literals of the element base type must be character literals (thus temporarily restricting one-dimensional character arrays to alternative "b" of question 1 within case statements)? Or, does it mean b. effectively nothing; that is, it is merely a restatement of the "definition" of a one-dimensional character array? Proposed Resolution ------------------- Adopt "a" as the answer to question 1 and "b" as the answer to question 2. Note that this proposed resolution implies that a case statement alternative having the choice of "others" *must* be used when the selector expression is of a one-dimensional character array type whose element subtype contains non- character literals. Std.Standard.String is one such type. VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD