aboutsummaryrefslogtreecommitdiff
path: root/src/randomart-1.bnf
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 08:19:44 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 08:23:19 +0000
commit5be0e39d0ce97849d7722bd1ac98563c7014faf3 (patch)
tree9dba821664337a6662a6da88dfe86291d269c36b /src/randomart-1.bnf
downloadlab-05-5be0e39d0ce97849d7722bd1ac98563c7014faf3.tar.gz
publishHEADmaster
Diffstat (limited to 'src/randomart-1.bnf')
-rw-r--r--src/randomart-1.bnf10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/randomart-1.bnf b/src/randomart-1.bnf
new file mode 100644
index 0000000..b7f6fd5
--- /dev/null
+++ b/src/randomart-1.bnf
@@ -0,0 +1,10 @@
1# randomart.bnf -- syntax with semantics for generating random art -*- BNF -*-
2 <expr> ::= <value> | 0 "-" <expr> | 10 <binop> | <trig> | 0 "abs(" <expr> ")" | "sqrt(abs(" <expr> "))"
3<value> ::= <coord> | 2 <mouse> | <time> | <const>
4<coord> ::= 4 "c.x" | 3 "c.y"
5<mouse> ::= 4 "m.x" | 3 "m.y"
6 <time> ::= "sin(t)" | 0 "cos(t)"
7<const> ::= "." <digit> <digit> <digit> <digit> <digit> <digit>
8<digit> ::= 2 "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
9<binop> ::= 10 "(" <expr> " + " <expr> ")" | 5 "(" <expr> " - " <expr> ")" | 3 <expr> "*" <expr> | 0 "(" <expr> "/" <expr> ")"
10 <trig> ::= "sin(" <expr> ")" | "cos(" <expr> ")" | "tan(" <expr> ")"