This repository has been archived on 2024-03-07. You can view files and clone it, but cannot push or open issues/pull-requests.
xmk/doc/grammar.bnf

29 lines
500 B
BNF
Raw Normal View History

2024-03-01 00:38:59 +00:00
MODULE ::= INSTR*
2024-03-02 06:36:52 +00:00
INSTR ::=
| EXPR semicolon
| ASSIGN semicolon
| ASSIGN_IF semicolon
| ASSIGN_ADD semicolon
| CMD_CALL semicolon
| CMD_DEF
2024-03-02 06:36:52 +00:00
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
2024-03-01 17:44:16 +00:00
EXPR ::= LITERAL
2024-03-02 06:36:52 +00:00
LITERAL ::=
| BUILTIN
| ARRAY
| ident
2024-03-01 16:06:10 +00:00
BUILTIN ::=
| bool
| float
| int
| string
2024-03-02 13:59:24 +00:00
| symbol
2024-03-01 17:44:16 +00:00
ARRAY ::= osquare EXPR* csquare