X hits on this document

1252 views

0 shares

0 downloads

0 comments

47 / 396

C# LANGUAGE SPECIFICATION

block: {   statement-listopt   }

is shorthand for:

block: {   } {   statement-list   }

and defines a block to consist of an optional statement-list enclosed in “{” and “}” tokens.

Alternatives are normally listed on separate lines, though in cases where there are many alternatives, the phrase “one of” may precede a list of expansions given on a single line. This is simply shorthand for listing each of the alternatives on a separate line. For example, the production:

real-type-suffix:  one of F  f  D  d  M  m

is shorthand for:

real-type-suffix: F f D d M m

2.2.2 Lexical grammar

The lexical grammar of C# is presented in §‎2.3, §‎2.3.3, and §‎2.5. The terminal symbols of the lexical grammar are the characters of the Unicode character set, and the lexical grammar specifies how characters are combined to form tokens (§‎2.4), white space (§‎2.3.3), comments (§‎2.3.2), and pre-processing directives (§‎2.5).

Every source file in a C# program must conform to the input production of the lexical grammar (§‎2.3).

2.2.3 Syntactic grammar

The syntactic grammar of C# is presented in the chapters and appendices that follow this chapter. The terminal symbols of the syntactic grammar are the tokens defined by the lexical grammar, and the syntactic grammar specifies how tokens are combined to form C# programs.

Every source file in a C# program must conform to the compilation-unit production of the syntactic grammar (§‎9.1).

2.3 Lexical analysis

The input production defines the lexical structure of a C# source file. 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

34Copyright Microsoft Corporation 1999-2003. All Rights Reserved.

Document info
Document views1252
Page views1252
Page last viewedFri Jan 20 06:54:55 UTC 2017
Pages396
Paragraphs9401
Words133190

Comments