From 76f808ea98313dc847f634b2d8e31066b7a1c68d Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Tue, 13 May 2025 15:45:50 +0200 Subject: make it work sometimes --- grammar/expr.gr | 9 --------- grammar/simple-cross-recursive.grm | 2 ++ grammar/simple-left-recursive.grm | 1 + grammar/simple-non-terminal.grm | 1 + grammar/simple-right-recursive.grm | 1 + grammar/simple-stupid.grm | 1 - grammar/simple.gr | 7 ------- 7 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 grammar/expr.gr create mode 100644 grammar/simple-cross-recursive.grm create mode 100644 grammar/simple-left-recursive.grm create mode 100644 grammar/simple-non-terminal.grm create mode 100644 grammar/simple-right-recursive.grm delete mode 100644 grammar/simple-stupid.grm delete mode 100644 grammar/simple.gr (limited to 'grammar') diff --git a/grammar/expr.gr b/grammar/expr.gr deleted file mode 100644 index 9705a4b..0000000 --- a/grammar/expr.gr +++ /dev/null @@ -1,9 +0,0 @@ -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-cross-recursive.grm b/grammar/simple-cross-recursive.grm new file mode 100644 index 0000000..6377886 --- /dev/null +++ b/grammar/simple-cross-recursive.grm @@ -0,0 +1,2 @@ +main -> other 'b' +other -> main | 'b' diff --git a/grammar/simple-left-recursive.grm b/grammar/simple-left-recursive.grm new file mode 100644 index 0000000..ed3797d --- /dev/null +++ b/grammar/simple-left-recursive.grm @@ -0,0 +1 @@ +main -> 'a' | main 'a' diff --git a/grammar/simple-non-terminal.grm b/grammar/simple-non-terminal.grm new file mode 100644 index 0000000..b43f786 --- /dev/null +++ b/grammar/simple-non-terminal.grm @@ -0,0 +1 @@ +main -> 'a' | 'aa' | 'aaa' diff --git a/grammar/simple-right-recursive.grm b/grammar/simple-right-recursive.grm new file mode 100644 index 0000000..1efcbb4 --- /dev/null +++ b/grammar/simple-right-recursive.grm @@ -0,0 +1 @@ +main -> 'a' | 'a' main diff --git a/grammar/simple-stupid.grm b/grammar/simple-stupid.grm deleted file mode 100644 index 1fa8992..0000000 --- a/grammar/simple-stupid.grm +++ /dev/null @@ -1 +0,0 @@ -main -> main 'b' | '' diff --git a/grammar/simple.gr b/grammar/simple.gr deleted file mode 100644 index 42b256f..0000000 --- a/grammar/simple.gr +++ /dev/null @@ -1,7 +0,0 @@ -S -> A S d -S -> B S -S -> _ -A -> a -A -> c -B -> a -B -> b -- cgit v1.2.3-70-g09d2