Jon Jagger
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 15 Statementsprevious at this levelnext at this level 15.4 Labeled statements Paragraph 11 A labeled-statement permits a statement to be prefixed by a label. 2 Labeled statements are permitted in blocks, but are not permitted as embedded statements. labeled-statement : identifier : statement Paragraph 21 A labeled statement declares a label with the name given by the identifier. 2 The scope of a label is the whole block in which the label is declared, including any nested blocks. 3 It is a compile-time error for two labels with the same name to have overlapping scopes. Paragraph 31 A label can be referenced from goto statements (§15.9.3) within the scope of the label. [Note: This means that goto statements can transfer control within blocks and out of blocks, but never into blocks. end note] Paragraph 41 Labels have their own declaration space and do not interfere with other identifiers. [Example: The example
int F(int x) {  
   if (x >= 0) goto x;  
   x = -x;  
   x: return x;  
is valid and uses the name x as both a parameter and a label. end example]
Paragraph 51 Execution of a labeled statement corresponds exactly to execution of the statement following the label. Paragraph 61 In addition to the reachability provided by normal flow of control, a labeled statement is reachable if the label is referenced by a reachable goto statement. 2 (Exception: If a goto statement is inside a try that includes a finally block, and the labeled statement is outside the try, and the end point of the finally block is unreachable, then the labeled statement is not reachable from that goto statement.)
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS