-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsyntax.ebnf
41 lines (29 loc) · 1.12 KB
/
syntax.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
literal ::= ? [0-9_]+ ?
identifier ::= ? \S+ ?
comment ::= ? #.+$ ?
sequence ::= ( '!' | '.' | '=' )*
euclidean ::= ( ':' <lit_expr> | <literal> ) ':' <lit_expr>
lit_infix ::= <lit_expr> ( '+' | '-' | '*' | '/' ) <lit_expr>
lit_prefix ::= ( "len" | "beats" | "skips" ) <seq_expr>
lit_expr ::=
<identifier> |
<lit_prefix> | <lit_infix> |
'(' <lit_expr> ')'
seq_prefix ::= ( '~' | '\'' ) <seq_expr>
seq_infix_expr ::= <seq_expr> ( '|' | '&' | '^' | ',' ) <seq_expr>
seq_infix_lit ::= <seq_expr> ( '<' | '>' | '**' ) <lit_expr>
seq_infix_lit ::= <seq_expr> "map" <lit_expr>+
seq_infix_lit ::= <seq_expr> "vel" <lit_expr>+
seq_infix_lit ::= <seq_expr> '@' <lit_expr>+
seq_infix_lit ::= <seq_expr> '=>' <identifier>
seq_infix ::= <seq_infix_expr> | <seq_infix_lit>
seq_postfix ::= <seq_expr> ( '?' | "car" | "cdr" )
seq_expr ::=
<identifier> | <sequence> |
<seq_prefix> | <seq_infix> | <seq_postfix> |
'(' <seq_expr> ')'
let ::= "let" ( <identifier> <lit_expr> )+
pat ::= "pat" <identifier> <timeline>
timeline ::= <seq_expr> [ '~>' <lit_expr> ] [ '$' <send>+ ]
stat ::= <let> | <timeline> | <pat>
program ::= <stat>*