diff options
Diffstat (limited to 'src/randomart-2.bnf')
| -rw-r--r-- | src/randomart-2.bnf | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/randomart-2.bnf b/src/randomart-2.bnf new file mode 100644 index 0000000..42507dd --- /dev/null +++ b/src/randomart-2.bnf | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # randomart.bnf -- syntax with semantics for generating random art -*- BNF -*- | ||
| 2 | <expr> ::= <value> | 0 "-" <expr> | 10 <binop> | 3 <trig> | 1 "abs(" <expr> ")" | 5 "sqrt(abs(" <expr> "))" | ||
| 3 | <value> ::= 3 <coord> | <mouse> | <time> | <const> | ||
| 4 | <coord> ::= 4 "c.x" | 3 "c.y" | ||
| 5 | <mouse> ::= 4 "m.x" | 3 "m.y" | ||
| 6 | <time> ::= "sin(t)" | "cos(t)" | ||
| 7 | <const> ::= "." <digit> <digit> <digit> <digit> <digit> <digit> | ||
| 8 | <digit> ::= 10 "0" | 9 "1" | 8 "2" | 7 "3" | 6 "4" | 5 "5" | 4 "6" | 3 "7" | 2 "8" | 1 "9" | ||
| 9 | <binop> ::= 1 "(" <expr> " + " <expr> ")" | 30 "(" <expr> " - " <expr> ")" | 5 <expr> "*" <expr> | 7 "(" <expr> "/" <expr> ")" | ||
| 10 | <trig> ::= "sin(" <expr> ")" | "cos(" <expr> ")" | 0 "tan(" <expr> ")" | ||
