Jon Jagger
jon@jaggersoft.com
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 Specificationpreviousnextprevious at this levelnext at this level 9 Lexical structureprevious at this levelnext at this level 9.3 Lexical analysisprevious at this levelnext at this level 9.3.2 Comments Paragraph 11 Two forms of comments are supported: delimited comments and single-line comments. Paragraph 21 A delimited comment begins with the characters /* and ends with the characters */. 2 Delimited comments can occupy a portion of a line, a single line, or multiple lines. [Example: The example
/* Hello, world program  
This program writes "hello, world" to the console  
*/  
class Hello  
{  
   static void Main() {  
      System.Console.WriteLine("hello, world");  
   }  
}  
includes a delimited comment. end example]
Paragraph 31 A single-line comment begins with the characters // and extends to the end of the line. [Example: The example
// Hello, world program  
//   This program writes "hello, world" to the console  
//  
class Hello // any name will do for this class  
{  
   static void Main() { // this method must be named "Main"  
      System.Console.WriteLine("hello, world");  
   }  
}  
shows several single-line comments. end example]
comment :: single-line-comment delimited-comment single-line-comment :: // input-charactersopt input-characters :: input-character input-characters input-character input-character :: Any Unicode character except a new-line-character new-line-character :: Carriage return character (U+000D) Line feed character (U+000A) Line separator character (U+2028) Paragraph separator character (U+2029) delimited-comment :: /* delimited-comment-charactersopt */ delimited-comment-characters :: delimited-comment-character delimited-comment-characters delimited-comment-character delimited-comment-character :: not-asterisk * not-slash not-asterisk :: Any Unicode character except * not-slash :: Any Unicode character except /
Paragraph 41 Comments do not nest. 2 The character sequences /* and */ have no special meaning within a single-line comment, and the character sequences // and /* have no special meaning within a delimited comment. Paragraph 51 Comments are not processed within character and string literals.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS