1 GLOBAL := ( FUNCTION | VARIABLE )*
2 FUNCTION := TYPE MODIFIERS _IDENTIFIER ARGSLIST ( ';' | STMTLIST )
5 ARGSLIST := '(' [ TYPE _IDENTIFIER ( ',' TYPE _IDENTIFIER)]* ] ')'
6 STMTLIST := '{' ( VARIABLE | STATEMENT | STMTLIST )* '}'
7 VARIABLE := TYPE MODIFIERS _IDENTIFIER [ = EXPRESSION ] ';'
8 STATEMENT := ( ';' | EXPRESSION ';' | WHILE | IF | RETURN )
9 WHILE := 'while' '(' EXPRESSION ')' CHUNK
10 IF := 'if' '(' EXPRESSION ')' CHUNK
11 RETURN := 'return' EXPRESSION ';'
12 CHUNK := ( STMTLIST | STATEMENT )
14 P13EXPR := P6EXPR ( '=' P6EXPR )*
15 P6EXPR := P5EXPR ( '==' P5EXPR )*
16 P5EXPR := P3EXPR ( ( '<' | '>' ) P3EXPR )*
17 P3EXPR := P2EXPR ( ( '+' | '-' ) P2EXPR )*
18 P2EXPR := _NUMBER ( ( '*' | '/' ) _NUMBER )*