29 lines
500 B
BNF
29 lines
500 B
BNF
MODULE ::= INSTR*
|
|
INSTR ::=
|
|
| EXPR semicolon
|
|
| ASSIGN semicolon
|
|
| ASSIGN_IF semicolon
|
|
| ASSIGN_ADD semicolon
|
|
| CMD_CALL semicolon
|
|
| CMD_DEF
|
|
|
|
ASSIGN ::= ident assign EXPR
|
|
ASSIGN_IF ::= ident assign_if EXPR
|
|
ASSIGN_ADD ::= ident assign_add EXPR
|
|
CMD_CALL ::= ident EXPR*
|
|
CMD_DEF ::= command ident colon EXPR* rarrow EXPR* BLOCK
|
|
BLOCK ::= obrace INSTR* cbrace
|
|
EXPR ::= LITERAL
|
|
LITERAL ::=
|
|
| BUILTIN
|
|
| ARRAY
|
|
| ident
|
|
BUILTIN ::=
|
|
| bool
|
|
| float
|
|
| int
|
|
| string
|
|
| symbol
|
|
|
|
ARRAY ::= osquare EXPR* csquare
|