From 3455539c6f8d157064cd9326a650f0e30f0266b0 Mon Sep 17 00:00:00 2001 From: Kia <kia@special-circumstanc.es> Date: Sat, 12 Dec 2020 22:02:24 -0700 Subject: [PATCH] add grammars from IELR papers as bases for litmus tests for analyzing the issue we are working on --- fun_with_bison/ielr_paper_fig_1_grammar.y | 19 ++++++++++++++ fun_with_bison/ielr_paper_fig_3_grammar.y | 25 ++++++++++++++++++ fun_with_bison/ielr_paper_fig_4_grammar.y | 21 +++++++++++++++ fun_with_bison/ielr_paper_fig_5_grammar.y | 32 +++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 fun_with_bison/ielr_paper_fig_1_grammar.y create mode 100644 fun_with_bison/ielr_paper_fig_3_grammar.y create mode 100644 fun_with_bison/ielr_paper_fig_4_grammar.y create mode 100644 fun_with_bison/ielr_paper_fig_5_grammar.y diff --git a/fun_with_bison/ielr_paper_fig_1_grammar.y b/fun_with_bison/ielr_paper_fig_1_grammar.y new file mode 100644 index 0000000..fcfdaa0 --- /dev/null +++ b/fun_with_bison/ielr_paper_fig_1_grammar.y @@ -0,0 +1,19 @@ +%define lr.type ielr +%define lr.default-reduction accepting + +/* BISON Declarations */ +%left small_a +%token small_b + +/* Grammar follows */ +%% + + +big_s: small_a big_a small_a + | small_b big_a small_b + + +big_a: small_a + | small_a small_a + +%% \ No newline at end of file diff --git a/fun_with_bison/ielr_paper_fig_3_grammar.y b/fun_with_bison/ielr_paper_fig_3_grammar.y new file mode 100644 index 0000000..e293412 --- /dev/null +++ b/fun_with_bison/ielr_paper_fig_3_grammar.y @@ -0,0 +1,25 @@ +%define lr.type ielr +%define lr.default-reduction accepting + +/* BISON Declarations */ +%token small_a +%token small_b +%token small_c + +/* Grammar follows */ +%% + + +big_s: small_a big_a small_a + | small_a big_b small_a + | small_a big_c small_a + | small_b big_a small_b + | small_b big_b small_a + | small_b big_c small_a + +big_a: small_a small_a +big_b: small_a small_a +big_c: small_a small_a + + +%% \ No newline at end of file diff --git a/fun_with_bison/ielr_paper_fig_4_grammar.y b/fun_with_bison/ielr_paper_fig_4_grammar.y new file mode 100644 index 0000000..5992496 --- /dev/null +++ b/fun_with_bison/ielr_paper_fig_4_grammar.y @@ -0,0 +1,21 @@ +%define lr.type ielr +%define lr.default-reduction accepting + +/* BISON Declarations */ +%token small_a +%token small_b + +/* Grammar follows */ +%% + + +big_s: small_a big_a small_a + | small_a big_a small_b + | small_a big_b small_a + | small_b big_a small_a + | small_b big_b small_b + +big_a: small_a +big_b: small_a + +%% \ No newline at end of file diff --git a/fun_with_bison/ielr_paper_fig_5_grammar.y b/fun_with_bison/ielr_paper_fig_5_grammar.y new file mode 100644 index 0000000..1c78c5d --- /dev/null +++ b/fun_with_bison/ielr_paper_fig_5_grammar.y @@ -0,0 +1,32 @@ +%define lr.type ielr +%define lr.default-reduction accepting + +/* BISON Declarations */ +%token small_c +%token small_b + +%precedence small_a +%precedence BAKA + + +/* Grammar follows */ +%% + + +big_s: small_a big_a big_b small_a + | small_b big_a big_b small_b + +big_a: small_a big_c big_d big_e + +big_b: small_c + | %empty + +big_c: big_d + +big_d: small_a + +big_e: small_a +big_e: %empty %prec BAKA + + +%% \ No newline at end of file -- GitLab