– Typee Documentation –

3 – Typee Language Description

3.7 – Statements Block

Blocks of statements are associated with compound statements, as seen before in this documentation. They are also used with functions, methods and classes definitions as it will be seen later in this documentation. Let’s first describe Typee grammar specification for blocks of statements.

The EBNF formal specification of statements blocks is this:

<statements block> ::= '{' [<statements list>] '}' |
                           <compound statement>    |
                           <simple statement>      |
                           [<nop statement>] ';'

<statements list>  ::= <statement>  ( <statement> )*

A block of statements is any simple or coumpound statement, a nop statement followed by a semi-colon, a semi-colon alone or a list of any statement enclosed in curly brackets.

Caution: Nesting blocks of statement is legal in Typee, but tokens {{ and }} being used to enclose embeded native code, programmers should avoid the concatenation of two or more successive curly brackets when nesting statements blocks.

 
Next section formerly explains <empty statements>.

< previous (3.6 simple statements) | (3.8 empty statements) next >