VHDL Issue Number: 1114 Classification: Language Definition Problem Language Version: VHDL-93 Summary: LRM wording doesn't account for separators. Related Issues: 1045 Relevant LRM Sections: 13, 13.2 Key Words and Phrases: lexical elements, separators Current Status: Submitted 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1995/05/26 Author of Submission: Daniel S. Barclay Author's Affiliation: COMPASS Design Automation, Inc. Author's Post Address: 5457 Twin Knolls Rd. Suite 100 Columbia, MD 21045 USA Author's Phone Number: 410-992-5700 Author's Fax Number: 410-992-3536 Author's Net Address: daniel@compass-da.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.2 $ Date Last Revised: $Date: 1995/05/26 20:13:11 $ Description of Problem ---------------------- The LRM does't say what it means. (That is, the wording does not actually define the intended language.) Specifically, the wording technically does not allow spaces, new-line characters, etc., as separators. Section 13 begins: The text of a design file is a sequence of lexical elements, each composed of characters[.] Clearly, a design file's text must be a sequence of lexical elements (however they are defined), and not a sequence of lexical elements _plus_ other inter- spersed things. Because lexical elements consists of characters, every char- acter in a design file must be part of a lexical element. Any sequence containing something that is not or is not part of a lexical element is not a design file. Section 13.2 defines what is a lexical element: ... Each lexical element is either a delimiter, an identifier (which may be a reserved word), an abstract literal, a character literal, a string literal, a bit string literal, or a comment. Clearly, anything that is not one of the things in the list is not a lexical element. Now consider separators. They are defined in the second paragraph of section 13.2: ... A separator is either a space character (SPACE or NBSP), a format effector, or the end of a line. A space character (SPACE or NBSP) is a separator except within a comment, a string literal, or a space character literal. None of these characters is or is part of anything that is one of the items listed in lexical elements list. Therefore, separators are not lexical elements. Since the text of a design file is a sequence of lexical elements, it contains no separators. Therefore, it contains no space characters, new-line characters, etc. For an example, consider the language string "entity e is end;". Is this a legal VHDL design file? The first six characters make up the first lexical element, the reserved-word identifier "entity". What is the seventh character (the space)? It is not part of anything that is one of those types of lexical elements. Therefore, the string is not a sequence of lexical elements. (It is a sequence of lexical elements plus some other things, but it is not a sequence of lexical elements). Therefore, the string is not a VHDL design file. Obviously, this is not the intent of the language. The problem results from the combination of the definition of a design file as a sequence of lexical elements (not lexical elements plus separators) and the fact that separators are not included as lexical elements. It is not clear which half of this combination should be changed. The LRM never says exactly how to apply the BNF syntactic productions. Specifically, do they specify the sequence of lexical elements, or of lexical elements ignoring comments? Two possible solutions are: 1. Define that a design file is a sequence of lexical elements _plus_ sepa- rators. Define comments as separators, not as lexical elements. Define that the BNF specifies the sequence of lexical elements within the sequences of lexical elements and interspersed separators. 2. Define that separators are lexical elements. Define that the BNF speci- fies the sequence of lexical elements ignoring those that are separa- tors or comments. (Then, optionally, define comments to be separators and simplify the wording.) Proposed Resolution ------------------- Do a right thing. Probably, define comments to be separators, define that design files contain separators as well as lexical elements, and define that the BNF syntax rules to the sequence of lexical elements (and not the sequence of lexical elements _and_ separators). VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1993 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD