Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.26 KB

summary-of-statements.md

File metadata and controls

65 lines (51 loc) · 2.26 KB
title description ms.date ms.assetid
Summary of C statements
A summary of the statement grammar in the Microsoft C implementation.
08/24/2020
ce45d2fe-ec0e-459f-afb1-80ab6a7f0239

Summary of C statements

statement:
labeled-statement
compound-statement
expression-statement
selection-statement
iteration-statement
jump-statement
try-except-statement /* Microsoft-specific */
try-finally-statement /* Microsoft-specific */

jump-statement:
goto identifier ;
continue ;
break ;
return expressionopt ;
__leave ; /* Microsoft-specific1 */

compound-statement:
{ declaration-listopt statement-listopt }

declaration-list:
declaration
declaration-list declaration

statement-list:
statement
statement-list statement

expression-statement:
expressionopt ;

iteration-statement:
while ( expression ) statement
do statement while ( expression ) ;
for ( expressionopt ; expressionopt ; expressionopt ) statement

selection-statement:
if ( expression ) statement
if ( expression ) statement else statement
switch ( expression ) statement

labeled-statement:
identifier : statement
case constant-expression : statement
default : statement

try-except-statement: /* Microsoft-specific */
__try compound-statement __except ( expression ) compound-statement

try-finally-statement: /* Microsoft-specific */
__try compound-statement __finally compound-statement

1 The __leave keyword is only valid within the __try block of a try-except-statement or a try-finally-statement.

See also

Phrase structure grammar