X hits on this document

813 views

0 shares

0 downloads

0 comments

50 / 396

Chapter ‎18   Unsafe code

// 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.

2.3.3 White space

White space is defined as any character with Unicode class Zs (which includes the space character) as well as the horizontal tab character, the vertical tab character, and the form feed character.

whitespace: Any character with Unicode class Zs Horizontal tab character (U+0009) Vertical tab character (U+000B) Form feed character (U+000C)

2.4 Tokens

There are several kinds of tokens: identifiers, keywords, literals, operators, and punctuators. White space and comments are not tokens, though they act as separators for tokens.

token: identifier keyword integer-literal real-literal character-literal string-literal operator-or-punctuator

2.4.1 Unicode character escape sequences

A Unicode character escape sequence represents a Unicode character. Unicode character escape sequences are processed in identifiers (§‎2.4.2), character literals (§‎2.4.4.4), and regular string literals (§‎2.4.4.5). A Unicode character escape is not processed in any other location (for example, to form an operator, punctuator, or keyword).

unicode-escape-sequence: \u   hex-digit   hex-digit   hex-digit   hex-digit \U   hex-digit   hex-digit   hex-digit  hex-digit   hex-digit   hex-digit   hex-digit   hex-digit

A Unicode escape sequence represents the single Unicode character formed by the hexadecimal number following the “\u” or “\U” characters. Since C# uses a 16-bit encoding of Unicode code points in characters and string values, a Unicode character in the range U+10000 to U+10FFFF is not permitted in a character literal and is represented using a Unicode surrogate pair in a string literal. Unicode characters with code points above 0x10FFFF are not supported.

Multiple translations are not performed. For instance, the string literal “\u005Cu005C” is equivalent to “\u005Crather than “\”. The Unicode value \u005C is the character “\”.

The example

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

Document info
Document views813
Page views813
Page last viewedSun Dec 04 06:39:13 UTC 2016
Pages396
Paragraphs9401
Words133190

Comments