-
Notifications
You must be signed in to change notification settings - Fork 0
/
bnf.txt
28 lines (22 loc) · 956 Bytes
/
bnf.txt
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
*This BNF may be outdated*
EBNF for Dats v2
<S> := <staff> <S> | <master> <S> | ;
<staff> := "staff" <identifier> "{" <nr> "}" ;
<master := "master" <identifier> "{" <stmt> "}" ;
<stmt> := <assignment> ";" <stmt> | <IO> ";" <stmt> | ;
<assignment> := "track" <identifier> "=" <track> ;
<track> :=
"synth" "." <synth_name> "(" <identifier> ")" ( "[" <options> "]" )? ("," <track>)?
| "filter" "." <filter_name> "(" <track> ")" ( "[" <options> "]" )? ("," <track>)?
| "mix" "(" "(" <track> ")" "," "(" <track> ")" ")" ("," <track>)?
| <identifier> ("," <track>)?
| ;
<IO> := "write" "(" <string> "," <track> ")" ;
<string> := "\"" (.+) "\"" ;
<identifier> := [^0-9]+[A-Za-z0-9_]+ ;
<nr> := "n" <length> "," <note> ";" <nr> | "r" <length> ";" <nr> | ;
<length> := (<integer> | <float>) (\.+)? ("+" <length>)? ;
<integer> := [0-9]+ ;
<float> := [0-9]+\.[0-9]+ ;
<note> := [a-g](#|b)?[0-9] (<articulation>)? <note> | ;
<articulation> := "."