Notational conventions

Lexical and syntactic grammars for C# are interspersed throughout this specification. The lexical grammar defines how characters can be combined to form tokens (9.4), the minimal lexical elements of the language. The syntactic grammar defines how tokens can be combined to make valid C# programs.
Grammar productions include both non-terminal and terminal symbols. In grammar productions, non-terminal symbols are shown in italic type, and terminal symbols are shown in a fixed-width font. Each non-terminal is defined by a set of productions. The first line of a set of productions is the name of the non-terminal, followed by a colon. Each successive indented line contains the right-hand side for a production that has the non-terminal symbol as the left-hand side. For example: class-modifier : newpublicprotectedinternalprivateabstractsealeddefines the class-modifier non-terminal as having seven productions.
Alternatives are normally listed on separate lines, as shown above, though in cases where there are many alternatives, the phrase "one of" precedes a list of the options. This is simply shorthand for listing each of the alternatives on a separate line. For example: decimal-digit : one of 0123456789is equivalent to: decimal-digit : 0123456789
A subscripted suffix "opt", as in identifier, is used as shorthand to indicate an optional symbol. The example: for-statement : for(for-initializer;for-condition;for-iterator)embedded-statementis equivalent to: for-statement : for(;;)embedded-statementfor(for-initializer;;)embedded-statementfor(;for-condition;)embedded-statementfor(;;for-iterator)embedded-statementfor(for-initializer;for-condition;)embedded-statementfor(;for-condition;for-iterator)embedded-statementfor(for-initializer;;for-iterator)embedded-statementfor(for-initializer;for-condition;for-iterator)embedded-statement
All terminal characters are to be understood as the appropriate Unicode character from the ASCII range, as opposed to any similar-looking characters from other Unicode ranges.