Syntax

Block ::= (Stmt `;´)* Stmt ::= | nothing | do Block end /* declarations */ | var    ID_type (`[´ NUM `]´)? ID_var (`=´ SetExp)? ( `,´ ID_var (`=´ SetExp)? )* | input  ID_type ID_ext (`,´ ID_ext)* | output ID_type ID_ext (`,´ ID_ext)* | event  ID_type ID_int (`,´ ID_int)* /* C declarations */ | C (pure|constant|nohold)? C_list | C do  end /* deterministic declaration */ | deterministic ID with ID (`,´ ID)* /* event manipulation */ | await (ID_ext|ID_int)    (`until´ Exp)? | await (WCLOCKK|WCLOCKE)  (`until´ Exp)? | await FOREVER | emit ID_ext (`(´ Exp? `)´)? | emit ID_int (`=´ Exp)? | emit (WCLOCKK|WCLOCKE) /* flow control */ | if Exp then Block (else/if Exp then Block)* (else Block)? end | loop (ID_var (`,´ Exp)?)? do Block end | every (Exp `=´)? (WCLOCKK|WCLOCKE|ID_ext|ID_int) do Block end | pause/if ID_int do Block end | async ( `(´ VarList `)´ )? do Block end | return Exp | break | continue /* parallel statements */ | par     do Block (with Block)+ end | par/or  do Block (with Block)+ end | par/and do Block (with Block)+ end /* function call */ | Exp `(´ ExpList? `)´ (finalize with Block end)? /* assignment */ | Exp `=´ SetExp | finalize Exp `=´ SetExp with Block end VarList ::= ID_var (`,´ ID_var)* ExpList ::= Exp (`,´ Exp)* C_list ::=  (C_type|C_func|C_var) (`,´ (C_type|C_func|C_var))* C_type ::=  ID_c `=´ NUM C_func ::=  ID_c `(´ `)´ C_var  ::=  ID_c SetExp ::= Exp  |    |   WCLOCKK ::= (NUM h)? (NUM min)? (NUM s)? (NUM ms)? (NUM us)? /* (at least one of these) */ WCLOCKE ::= `(´ Exp `)´ (h|min|s|ms|us) Exp ::= UNOP Exp |  Exp BINOP Exp | emit ID_ext (`(´ Exp? `)´)? | sizeof `<´ ID_type `>´ | `<´ ID_type `>´ Exp | Exp `[´ Exp `]´ | Exp `(´ ExpList? `)´ | `(´ Exp `)´ | ID_int  |  ID_var  |  ID_c  |  NUM | STRING  |  null /* The operators follow the same precedence of C. */ BINOP ::= `or´                            /* lowest precedence */ | `and´ | `|´           |  `^´           |  `&´           |  `!=´  |  `==´           |  `<=´  |  `>=´  |  `<´  |  `>´           |  `<<´  |  `>>´           |  `+´   |  `-´           |  `*´   |  `/´   |  `%´             | `.´   |  `:´                    /* highest precedence */ UNOP ::= `not´ |  `&´  |  `-´  |  `+´  |  `~´  |  `*´ ID     ::=  + ID_ext ::= ID    /* all in uppercase, not beginning with a digit */ ID_int ::= ID    /* beginning with a lowercase letter            */ ID_var ::= ID    /* beginning with a lowercase letter            */ ID_c   ::= ID    /* beginning with an underscore                 */ ID_type ::= ( ID_c | void | int               | s8 | s16 | s32 | s64                | u8 | u16 | u32 | u64 ) (`*´ *)