Next: , Previous: , Up: Grammar   [Contents][Index]

4.7 Complex statements

The coNCePTuaL statements presented in Communication statements, I/O statements, and Other statements are all known as simple statements. This section expands upon the statements already introduced by presenting complex statements. In its most basic form, a <complex_stmt> is just a <simple_stmt>. However, the primary purpose of a <complex_stmt> is to juxtapose simple statements and other complex statements into more expressive forms.

Complex statements take the following form:

<complex_stmt> ::= <simple_stmt> [ THEN <complex_stmt>]

The constituent simple statements include FOR loops, LET bindings, IF conditionals, grouping constructs, and all of the statements introduced in Communication statements, I/O statements, and Other statements:

<simple_stmt> ::= FOR <expr> REPETITIONS [ PLUS <expr> WARMUP REPETITIONS [ AND A SYNCHRONIZATION]] <simple_stmt>
| FOR EACH <ident> IN <range> [‘, <range>]* <simple_stmt>
| FOR <expr> <time_unit> [ PLUS <expr> WARMUP <time_unit> [ AND A SYNCHRONIZATION]] <simple_stmt>
| LET <let_binding> [ AND <let_binding>]* WHILE <simple_stmt>
| IF <rel_expr> THEN <simple_stmt> [ OTHERWISE <simple_stmt>]
| {’ [ <complex_stmt>] ‘}
| <send_stmt>
| <receive_stmt>
| <wait_stmt>
| <mcast_stmt>
| <reduce_stmt>
| <sync_stmt>
| <output_stmt>
| <log_stmt>
| <flush_stmt>
| <reset_stmt>
| <store_stmt>
| <restore_stmt>
| <assert_stmt>
| <delay_stmt>
| <touch_stmt>
| <touch_buffer_stmt>
| <processor_stmt>
| <backend_stmt>

The remainder of this section describes in turn the THEN construct and each of the just-introduced <simple_stmt> types.

Next: , Previous: , Up: Grammar   [Contents][Index]

Scott Pakin,