Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification 9 Lexical structure 9.3 Lexical analysis
Paragraph 11 The input production defines the lexical structure of a C# source file. 2 Each source file in a C# program must conform to this lexical grammar production. input :: input-sectionopt input-section :: input-section-part input-section input-section-part input-section-part :: input-elementsopt new-line pp-directive input-elements :: input-element input-elements input-element input-element :: whitespace comment token
Paragraph 21 Five basic elements make up the lexical structure of a C# source file: Line terminators (§9.3.1), white space (§9.3.3), comments (§9.3.2), tokens (§9.4), and pre-processing directives (§9.5). 2 Of these basic elements, only tokens are significant in the syntactic grammar of a C# program (§9.2.2).
Paragraph 31 The lexical processing of a C# source file consists of reducing the file into a sequence of tokens which becomes the input to the syntactic analysis. 2 Line terminators, white space, and comments can serve to separate tokens, and pre-processing directives can cause sections of the source file to be skipped, but otherwise these lexical elements have no impact on the syntactic structure of a C# program.
Paragraph 41 When several lexical grammar productions match a sequence of characters in a source file, the lexical processing always forms the longest possible lexical element. [Example: For example, the character sequence // is processed as the beginning of a single-line comment because that lexical element is longer than a single / token. end example]
|Jagger Software Ltd|
|Company # 4070126|
|VAT # 762 5213 42|