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 0000000000000000000000000000000000000000..fcfdaa05aa06591b70e55e81541647519eb6fafb --- /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 0000000000000000000000000000000000000000..e293412079cb6eda0df1bf00ddd93d679fd8f186 --- /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 0000000000000000000000000000000000000000..599249681e225f72212257ebe97b4c6cd8151e17 --- /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 0000000000000000000000000000000000000000..1c78c5dd6d49ec2ad8f024bc66767d5f46371cfa --- /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