NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

22.8 Statements Grammar

8.2 Blocks

block:
{ statement-listopt }

8.2.1 Statement lists

statement-list:
statement
statement-list statement

8.3 The empty statement

empty-statement:
;

8.4 Labeled statements

labeled-statement:
identifier : statement

8.5 Declaration statements

declaration-statement:
local-variable-declaration ;
local-constant-declaration
;

8.5.1 Local variable declarations

local-variable-declaration:
type variable-declarators
variable-declarators:
variable-declarator
variable-declarators
, variable-declarator
variable-declarator:
identifier
identifier = variable-initializer
variable-initializer:
expression
array-initializer

8.5.2 Local constant declarations

local-constant-declaration:
const type constant-declarators
constant-declarators:
constant-declarator
constant-declarators
, constant-declarator
constant-declarator:
identifier = constant-expression

8.6 Expression statements

expression-statement:
statement-expression ;
statement-expression:
invocation-expression
object-creation-expression
assignment
post-increment-expression
post-decrement-expression
pre-increment-expression
pre-decrement-expression

8.7 Selection statements

selection-statement:
if-statement
switch-statement

8.7.1 The if statement

if-statement:
if ( boolean-expression ) embedded-statement
if ( boolean-expression ) embedded-statement else embedded-statement
boolean-expression:
expression

8.7.2 The switch statement

switch-statement:
switch ( expression ) switch-block
switch-block:
{ switch-sectionsopt }
switch-sections:
switch-section
switch-sections switch-section
switch-section:
switch-labels statement-list
switch-labels:
switch-label
switch-labels switch-label
switch-label:
case constant-expression :
default :

8.8 Iteration statements

iteration-statement:
while-statement
do-statement
for-statement
foreach-statement

8.8.1 The while statement

while-statement:
while ( boolean-expression ) embedded-statement

8.8.2 The do statement

do-statement:
do embedded-statement while ( boolean-expression ) ;

8.8.3 The for statement

for-statement:
for ( for-initializeropt ; for-conditionopt ; for-iteratoropt ) embedded-statement
for-initializer:
local-variable-declaration
statement-expression-list
for-condition:
boolean-expression
for-iterator:
statement-expression-list
statement-expression-list:
statement-expression
statement-expression-list
, statement-expression

8.8.4 The foreach statement

foreach-statement:
foreach ( type identifier in expression ) embedded-statement

8.9 Jump statements

jump-statement:
break-statement
continue-statement
goto-statement
return-statement
throw-statement

8.9.1 The break statement

break-statement:
break ;

8.9.2 The continue statement

continue-statement:
continue ;

8.9.3 The goto statement

goto-statement:
goto identifier ;
goto case constant-expression ;
goto default ;

8.9.4 The return statement

return-statement:
return expressionopt ;

8.9.5 The throw statement

throw-statement:
throw expressionopt ;

8.10 The try statement

try-statement:
try block catch-clauses
try block finally-clause
try block catch-clauses finally-clause
catch-clauses:
specific-catch-clauses general-catch-clauseopt
specific-catch-clausesopt general-catch-clause
specific-catch-clauses:
specific-catch-clause
specific-catch-clauses specific-catch-clause
specific-catch-clause:
catch ( class-type identifieropt ) block
general-catch-clause:
catch block
finally-clause:
finally block

8.11 The checked and unchecked statements

checked-statement:
checked block
unchecked-statement:
unchecked block

8.12 The lock statement

lock-statement:
lock ( expression ) embedded-statement