fakir/doc/grammar.bnf

23 lines
472 B
BNF
Raw Normal View History

MODULE ::= EXPR*
EXPR ::=
| int | float | bool | string
2023-09-20 15:17:13 +00:00
| ident
| CALL
| LAMBDA
| FUNDECL
2023-09-23 17:21:55 +00:00
| VARDECL
| NS
| IMPORT
2023-09-23 22:40:08 +00:00
| ARRAY
CALL ::= opar EXPR EXPR* cpar
LAMBDA ::= opar rarrow opar PARAMS cpar BODY cpar
PARAMS ::= ident*
BODY ::= EXPR*
FUNDECL ::=
2023-09-23 17:21:55 +00:00
| opar decl opar ident PARAMS cpar BODY cpar
VARDECL ::= opar decl ident EXPR cpar
NS ::= ident ns ident
IMPORT ::= opar import string cpar
SHORT_IMPORT ::= opar decl import ident string? cpar
2023-09-23 22:40:08 +00:00
ARRAY ::= osquare EXPR* csquare