aboutsummaryrefslogtreecommitdiff
path: root/grammar
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-04-26 14:23:28 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2025-04-26 14:23:28 +0200
commitcf4d53c3eb35028839e6b267230c23df68b1e94a (patch)
treeac564add1e8b0ee1b9d111a7692ec2ab7fc0499e /grammar
parentf593da7580f423b1405f4705081368acef0b3c21 (diff)
first working implementation (unoptimized)
Diffstat (limited to 'grammar')
-rw-r--r--grammar/expr.gr9
-rw-r--r--grammar/simple.gr7
2 files changed, 16 insertions, 0 deletions
diff --git a/grammar/expr.gr b/grammar/expr.gr
new file mode 100644
index 0000000..9705a4b
--- /dev/null
+++ b/grammar/expr.gr
@@ -0,0 +1,9 @@
+S -> B A
+A -> + B A
+A -> _
+B -> D C
+C -> * D C
+C -> _
+D -> ( S )
+D -> a
+D -> b
diff --git a/grammar/simple.gr b/grammar/simple.gr
new file mode 100644
index 0000000..42b256f
--- /dev/null
+++ b/grammar/simple.gr
@@ -0,0 +1,7 @@
+S -> A S d
+S -> B S
+S -> _
+A -> a
+A -> c
+B -> a
+B -> b