From b639c9e88bfe1f579704380ecf18a9dde7b5a4de Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 7 Mar 2016 05:47:43 -0500 Subject: [PATCH] Port lalrpop-test to use new `Configuration` value Also, start emitting comments again, since they are helpful to ME. --- lalrpop-test/build.rs | 6 +- lalrpop-test/src/error.rs | 48 + lalrpop-test/src/expr.rs | 664 ++++++++++++ lalrpop-test/src/expr_arena.rs | 1527 +++++++++++++++++++++++++++ lalrpop-test/src/expr_generic.rs | 664 ++++++++++++ lalrpop-test/src/expr_intern_tok.rs | 756 +++++++++++++ lalrpop-test/src/expr_lalr.rs | 568 ++++++++++ lalrpop-test/src/inline.rs | 53 + lalrpop-test/src/intern_tok.rs | 61 ++ lalrpop-test/src/lifetime_tok.rs | 41 + lalrpop-test/src/loc.rs | 61 ++ lalrpop-test/src/loc_issue_90.rs | 437 ++++++++ lalrpop-test/src/sub.rs | 163 +++ lalrpop-test/src/use_super.rs | 22 + 14 files changed, 5070 insertions(+), 1 deletion(-) diff --git a/lalrpop-test/build.rs b/lalrpop-test/build.rs index e28f398..d581323 100644 --- a/lalrpop-test/build.rs +++ b/lalrpop-test/build.rs @@ -1,5 +1,9 @@ extern crate lalrpop; fn main() { - lalrpop::process_root_unconditionally().unwrap(); + lalrpop::Configuration::new() + .emit_comments(true) + .force_build(true) + .process_current_dir() + .unwrap(); } diff --git a/lalrpop-test/src/error.rs b/lalrpop-test/src/error.rs index ec02001..12793ce 100644 --- a/lalrpop-test/src/error.rs +++ b/lalrpop-test/src/error.rs @@ -43,6 +43,23 @@ mod __parse__Items { ____Items((usize, Vec<(usize, usize)>, usize)), } + // State 0 + // Items = (*) [EOF] + // Items = (*) ["+"] + // Items = (*) ["-"] + // Items = (*) Items "+" [EOF] + // Items = (*) Items "+" ["+"] + // Items = (*) Items "+" ["-"] + // Items = (*) Items "-" [EOF] + // Items = (*) Items "-" ["+"] + // Items = (*) Items "-" ["-"] + // __Items = (*) Items [EOF] + // + // EOF -> Reduce(Items = => ActionFn(1);) + // "+" -> Reduce(Items = => ActionFn(1);) + // "-" -> Reduce(Items = => ActionFn(1);) + // + // Items -> S1 pub fn __state0< __TOKENS: Iterator>, >( @@ -86,6 +103,19 @@ mod __parse__Items { } } + // State 1 + // Items = Items (*) "+" [EOF] + // Items = Items (*) "+" ["+"] + // Items = Items (*) "+" ["-"] + // Items = Items (*) "-" [EOF] + // Items = Items (*) "-" ["+"] + // Items = Items (*) "-" ["-"] + // __Items = Items (*) [EOF] + // + // EOF -> Reduce(__Items = Items => ActionFn(0);) + // "+" -> Shift(S2) + // "-" -> Shift(S3) + // pub fn __state1< __TOKENS: Iterator>, >( @@ -126,6 +156,15 @@ mod __parse__Items { return Ok(__result); } + // State 2 + // Items = Items "+" (*) [EOF] + // Items = Items "+" (*) ["+"] + // Items = Items "+" (*) ["-"] + // + // EOF -> Reduce(Items = Items, "+" => ActionFn(2);) + // "+" -> Reduce(Items = Items, "+" => ActionFn(2);) + // "-" -> Reduce(Items = Items, "+" => ActionFn(2);) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -165,6 +204,15 @@ mod __parse__Items { } } + // State 3 + // Items = Items "-" (*) [EOF] + // Items = Items "-" (*) ["+"] + // Items = Items "-" (*) ["-"] + // + // EOF -> Reduce(Items = Items, "-" => ActionFn(3);) + // "+" -> Reduce(Items = Items, "-" => ActionFn(3);) + // "-" -> Reduce(Items = Items, "-" => ActionFn(3);) + // pub fn __state3< __TOKENS: Iterator>, >( diff --git a/lalrpop-test/src/expr.rs b/lalrpop-test/src/expr.rs index f57c21b..ada994a 100644 --- a/lalrpop-test/src/expr.rs +++ b/lalrpop-test/src/expr.rs @@ -45,6 +45,49 @@ mod __parse__Expr { ____Expr(((), i32, ())), } + // State 0 + // Expr = (*) Expr "+" Factor [EOF] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [EOF] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [EOF] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // __Expr = (*) Expr [EOF] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Expr -> S1 + // Factor -> S2 + // Term -> S3 pub fn __state0< __TOKENS: Iterator>, >( @@ -92,6 +135,19 @@ mod __parse__Expr { } } + // State 1 + // Expr = Expr (*) "+" Factor [EOF] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [EOF] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // "+" -> Shift(S6) + // "-" -> Shift(S7) + // pub fn __state1< __TOKENS: Iterator>, >( @@ -133,6 +189,27 @@ mod __parse__Expr { return Ok(__result); } + // State 2 + // Expr = Factor (*) [EOF] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S9) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -176,6 +253,19 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Factor = Term (*) [EOF] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // EOF -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state3< __TOKENS: Iterator>, >( @@ -212,6 +302,53 @@ mod __parse__Expr { } } + // State 4 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [EOF] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Expr -> S10 + // Factor -> S11 + // Term -> S12 pub fn __state4< __TOKENS: Iterator>, >( @@ -265,6 +402,19 @@ mod __parse__Expr { return Ok(__result); } + // State 5 + // Term = Num (*) [EOF] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // EOF -> Reduce(Term = Num => ActionFn(7);) + // "*" -> Reduce(Term = Num => ActionFn(7);) + // "+" -> Reduce(Term = Num => ActionFn(7);) + // "-" -> Reduce(Term = Num => ActionFn(7);) + // "/" -> Reduce(Term = Num => ActionFn(7);) + // pub fn __state5< __TOKENS: Iterator>, >( @@ -305,6 +455,41 @@ mod __parse__Expr { } } + // State 6 + // Expr = Expr "+" (*) Factor [EOF] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Factor -> S15 + // Term -> S3 pub fn __state6< __TOKENS: Iterator>, >( @@ -355,6 +540,41 @@ mod __parse__Expr { return Ok(__result); } + // State 7 + // Expr = Expr "-" (*) Factor [EOF] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Factor -> S16 + // Term -> S3 pub fn __state7< __TOKENS: Iterator>, >( @@ -405,6 +625,27 @@ mod __parse__Expr { return Ok(__result); } + // State 8 + // Factor = Factor "*" (*) Term [EOF] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Term -> S17 pub fn __state8< __TOKENS: Iterator>, >( @@ -451,6 +692,27 @@ mod __parse__Expr { return Ok(__result); } + // State 9 + // Factor = Factor "/" (*) Term [EOF] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Term -> S18 pub fn __state9< __TOKENS: Iterator>, >( @@ -497,6 +759,23 @@ mod __parse__Expr { return Ok(__result); } + // State 10 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [EOF] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S19) + // "+" -> Shift(S20) + // "-" -> Shift(S21) + // pub fn __state10< __TOKENS: Iterator>, >( @@ -531,6 +810,27 @@ mod __parse__Expr { return Ok(__result); } + // State 11 + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S23) + // pub fn __state11< __TOKENS: Iterator>, >( @@ -574,6 +874,19 @@ mod __parse__Expr { return Ok(__result); } + // State 12 + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // ")" -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state12< __TOKENS: Iterator>, >( @@ -610,6 +923,53 @@ mod __parse__Expr { } } + // State 13 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Expr -> S24 + // Factor -> S11 + // Term -> S12 pub fn __state13< __TOKENS: Iterator>, >( @@ -663,6 +1023,19 @@ mod __parse__Expr { return Ok(__result); } + // State 14 + // Term = Num (*) [")"] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // ")" -> Reduce(Term = Num => ActionFn(7);) + // "*" -> Reduce(Term = Num => ActionFn(7);) + // "+" -> Reduce(Term = Num => ActionFn(7);) + // "-" -> Reduce(Term = Num => ActionFn(7);) + // "/" -> Reduce(Term = Num => ActionFn(7);) + // pub fn __state14< __TOKENS: Iterator>, >( @@ -703,6 +1076,27 @@ mod __parse__Expr { } } + // State 15 + // Expr = Expr "+" Factor (*) [EOF] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S9) + // pub fn __state15< __TOKENS: Iterator>, >( @@ -750,6 +1144,27 @@ mod __parse__Expr { return Ok(__result); } + // State 16 + // Expr = Expr "-" Factor (*) [EOF] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S9) + // pub fn __state16< __TOKENS: Iterator>, >( @@ -797,6 +1212,19 @@ mod __parse__Expr { return Ok(__result); } + // State 17 + // Factor = Factor "*" Term (*) [EOF] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state17< __TOKENS: Iterator>, >( @@ -837,6 +1265,19 @@ mod __parse__Expr { } } + // State 18 + // Factor = Factor "/" Term (*) [EOF] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state18< __TOKENS: Iterator>, >( @@ -877,6 +1318,19 @@ mod __parse__Expr { } } + // State 19 + // Term = "(" Expr ")" (*) [EOF] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // EOF -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state19< __TOKENS: Iterator>, >( @@ -921,6 +1375,41 @@ mod __parse__Expr { } } + // State 20 + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Factor -> S25 + // Term -> S12 pub fn __state20< __TOKENS: Iterator>, >( @@ -971,6 +1460,41 @@ mod __parse__Expr { return Ok(__result); } + // State 21 + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Factor -> S26 + // Term -> S12 pub fn __state21< __TOKENS: Iterator>, >( @@ -1021,6 +1545,27 @@ mod __parse__Expr { return Ok(__result); } + // State 22 + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Term -> S27 pub fn __state22< __TOKENS: Iterator>, >( @@ -1067,6 +1612,27 @@ mod __parse__Expr { return Ok(__result); } + // State 23 + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S13) + // Num -> Shift(S14) + // + // Term -> S28 pub fn __state23< __TOKENS: Iterator>, >( @@ -1113,6 +1679,23 @@ mod __parse__Expr { return Ok(__result); } + // State 24 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S29) + // "+" -> Shift(S20) + // "-" -> Shift(S21) + // pub fn __state24< __TOKENS: Iterator>, >( @@ -1147,6 +1730,27 @@ mod __parse__Expr { return Ok(__result); } + // State 25 + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S23) + // pub fn __state25< __TOKENS: Iterator>, >( @@ -1194,6 +1798,27 @@ mod __parse__Expr { return Ok(__result); } + // State 26 + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S23) + // pub fn __state26< __TOKENS: Iterator>, >( @@ -1241,6 +1866,19 @@ mod __parse__Expr { return Ok(__result); } + // State 27 + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state27< __TOKENS: Iterator>, >( @@ -1281,6 +1919,19 @@ mod __parse__Expr { } } + // State 28 + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state28< __TOKENS: Iterator>, >( @@ -1321,6 +1972,19 @@ mod __parse__Expr { } } + // State 29 + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state29< __TOKENS: Iterator>, >( diff --git a/lalrpop-test/src/expr_arena.rs b/lalrpop-test/src/expr_arena.rs index 0a7b360..de6eea0 100644 --- a/lalrpop-test/src/expr_arena.rs +++ b/lalrpop-test/src/expr_arena.rs @@ -53,6 +53,55 @@ mod __parse__Expr { ____Expr((usize, &'ast Node<'ast>, usize)), } + // State 0 + // Expr = (*) Expr "+" Factor [EOF] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [EOF] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [EOF] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [EOF] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // __Expr = (*) Expr [EOF] + // + // "(" -> Shift(S4) + // "*" -> Shift(S5) + // Num -> Shift(S6) + // + // Expr -> S1 + // Factor -> S2 + // Term -> S3 pub fn __state0< 'ast, __TOKENS: Iterator>, @@ -105,6 +154,19 @@ mod __parse__Expr { } } + // State 1 + // Expr = Expr (*) "+" Factor [EOF] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [EOF] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // "+" -> Shift(S7) + // "-" -> Shift(S8) + // pub fn __state1< 'ast, __TOKENS: Iterator>, @@ -147,6 +209,27 @@ mod __parse__Expr { return Ok(__result); } + // State 2 + // Expr = Factor (*) [EOF] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S10) + // pub fn __state2< 'ast, __TOKENS: Iterator>, @@ -191,6 +274,19 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Factor = Term (*) [EOF] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // EOF -> Reduce(Factor = Term => ActionFn(7);) + // "*" -> Reduce(Factor = Term => ActionFn(7);) + // "+" -> Reduce(Factor = Term => ActionFn(7);) + // "-" -> Reduce(Factor = Term => ActionFn(7);) + // "/" -> Reduce(Factor = Term => ActionFn(7);) + // pub fn __state3< 'ast, __TOKENS: Iterator>, @@ -228,6 +324,59 @@ mod __parse__Expr { } } + // State 4 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [EOF] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // "*" -> Shift(S15) + // Num -> Shift(S16) + // + // Expr -> S11 + // Factor -> S12 + // Term -> S13 pub fn __state4< 'ast, __TOKENS: Iterator>, @@ -286,6 +435,15 @@ mod __parse__Expr { return Ok(__result); } + // State 5 + // Factor = "*" (*) "(" Comma ")" [EOF] + // Factor = "*" (*) "(" Comma ")" ["*"] + // Factor = "*" (*) "(" Comma ")" ["+"] + // Factor = "*" (*) "(" Comma ")" ["-"] + // Factor = "*" (*) "(" Comma ")" ["/"] + // + // "(" -> Shift(S17) + // pub fn __state5< 'ast, __TOKENS: Iterator>, @@ -316,6 +474,19 @@ mod __parse__Expr { return Ok(__result); } + // State 6 + // Term = Num (*) [EOF] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // EOF -> Reduce(Term = Num => ActionFn(8);) + // "*" -> Reduce(Term = Num => ActionFn(8);) + // "+" -> Reduce(Term = Num => ActionFn(8);) + // "-" -> Reduce(Term = Num => ActionFn(8);) + // "/" -> Reduce(Term = Num => ActionFn(8);) + // pub fn __state6< 'ast, __TOKENS: Iterator>, @@ -357,6 +528,47 @@ mod __parse__Expr { } } + // State 7 + // Expr = Expr "+" (*) Factor [EOF] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [EOF] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // "*" -> Shift(S5) + // Num -> Shift(S6) + // + // Factor -> S18 + // Term -> S3 pub fn __state7< 'ast, __TOKENS: Iterator>, @@ -412,6 +624,47 @@ mod __parse__Expr { return Ok(__result); } + // State 8 + // Expr = Expr "-" (*) Factor [EOF] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [EOF] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // "*" -> Shift(S5) + // Num -> Shift(S6) + // + // Factor -> S19 + // Term -> S3 pub fn __state8< 'ast, __TOKENS: Iterator>, @@ -467,6 +720,27 @@ mod __parse__Expr { return Ok(__result); } + // State 9 + // Factor = Factor "*" (*) Term [EOF] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S6) + // + // Term -> S20 pub fn __state9< 'ast, __TOKENS: Iterator>, @@ -514,6 +788,27 @@ mod __parse__Expr { return Ok(__result); } + // State 10 + // Factor = Factor "/" (*) Term [EOF] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S6) + // + // Term -> S21 pub fn __state10< 'ast, __TOKENS: Iterator>, @@ -561,6 +856,23 @@ mod __parse__Expr { return Ok(__result); } + // State 11 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [EOF] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S22) + // "+" -> Shift(S23) + // "-" -> Shift(S24) + // pub fn __state11< 'ast, __TOKENS: Iterator>, @@ -596,6 +908,27 @@ mod __parse__Expr { return Ok(__result); } + // State 12 + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S25) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S26) + // pub fn __state12< 'ast, __TOKENS: Iterator>, @@ -640,6 +973,19 @@ mod __parse__Expr { return Ok(__result); } + // State 13 + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // ")" -> Reduce(Factor = Term => ActionFn(7);) + // "*" -> Reduce(Factor = Term => ActionFn(7);) + // "+" -> Reduce(Factor = Term => ActionFn(7);) + // "-" -> Reduce(Factor = Term => ActionFn(7);) + // "/" -> Reduce(Factor = Term => ActionFn(7);) + // pub fn __state13< 'ast, __TOKENS: Iterator>, @@ -677,6 +1023,59 @@ mod __parse__Expr { } } + // State 14 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // "*" -> Shift(S15) + // Num -> Shift(S16) + // + // Expr -> S27 + // Factor -> S12 + // Term -> S13 pub fn __state14< 'ast, __TOKENS: Iterator>, @@ -735,6 +1134,15 @@ mod __parse__Expr { return Ok(__result); } + // State 15 + // Factor = "*" (*) "(" Comma ")" [")"] + // Factor = "*" (*) "(" Comma ")" ["*"] + // Factor = "*" (*) "(" Comma ")" ["+"] + // Factor = "*" (*) "(" Comma ")" ["-"] + // Factor = "*" (*) "(" Comma ")" ["/"] + // + // "(" -> Shift(S28) + // pub fn __state15< 'ast, __TOKENS: Iterator>, @@ -765,6 +1173,19 @@ mod __parse__Expr { return Ok(__result); } + // State 16 + // Term = Num (*) [")"] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // ")" -> Reduce(Term = Num => ActionFn(8);) + // "*" -> Reduce(Term = Num => ActionFn(8);) + // "+" -> Reduce(Term = Num => ActionFn(8);) + // "-" -> Reduce(Term = Num => ActionFn(8);) + // "/" -> Reduce(Term = Num => ActionFn(8);) + // pub fn __state16< 'ast, __TOKENS: Iterator>, @@ -806,6 +1227,83 @@ mod __parse__Expr { } } + // State 17 + // ( ",")+ = (*) ( ",")+ Expr "," ["("] + // ( ",")+ = (*) ( ",")+ Expr "," [")"] + // ( ",")+ = (*) ( ",")+ Expr "," ["*"] + // ( ",")+ = (*) ( ",")+ Expr "," [Num] + // ( ",")+ = (*) Expr "," ["("] + // ( ",")+ = (*) Expr "," [")"] + // ( ",")+ = (*) Expr "," ["*"] + // ( ",")+ = (*) Expr "," [Num] + // Comma = (*) [")"] + // Comma = (*) ( ",")+ [")"] + // Comma = (*) ( ",")+ Expr [")"] + // Comma = (*) Expr [")"] + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor [","] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor [","] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor [","] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Factor = "*" "(" (*) Comma ")" [EOF] + // Factor = "*" "(" (*) Comma ")" ["*"] + // Factor = "*" "(" (*) Comma ")" ["+"] + // Factor = "*" "(" (*) Comma ")" ["-"] + // Factor = "*" "(" (*) Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // ")" -> Reduce(Comma = => ActionFn(23);) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // ( ",")+ -> S29 + // Comma -> S30 + // Expr -> S31 + // Factor -> S32 + // Term -> S33 pub fn __state17< 'ast, __TOKENS: Iterator>, @@ -884,6 +1382,27 @@ mod __parse__Expr { return Ok(__result); } + // State 18 + // Expr = Expr "+" Factor (*) [EOF] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S10) + // pub fn __state18< 'ast, __TOKENS: Iterator>, @@ -932,6 +1451,27 @@ mod __parse__Expr { return Ok(__result); } + // State 19 + // Expr = Expr "-" Factor (*) [EOF] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S10) + // pub fn __state19< 'ast, __TOKENS: Iterator>, @@ -980,6 +1520,19 @@ mod __parse__Expr { return Ok(__result); } + // State 20 + // Factor = Factor "*" Term (*) [EOF] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state20< 'ast, __TOKENS: Iterator>, @@ -1021,6 +1574,19 @@ mod __parse__Expr { } } + // State 21 + // Factor = Factor "/" Term (*) [EOF] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state21< 'ast, __TOKENS: Iterator>, @@ -1062,6 +1628,19 @@ mod __parse__Expr { } } + // State 22 + // Term = "(" Expr ")" (*) [EOF] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // EOF -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // pub fn __state22< 'ast, __TOKENS: Iterator>, @@ -1107,6 +1686,47 @@ mod __parse__Expr { } } + // State 23 + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // "*" -> Shift(S15) + // Num -> Shift(S16) + // + // Factor -> S37 + // Term -> S13 pub fn __state23< 'ast, __TOKENS: Iterator>, @@ -1162,6 +1782,47 @@ mod __parse__Expr { return Ok(__result); } + // State 24 + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // "*" -> Shift(S15) + // Num -> Shift(S16) + // + // Factor -> S38 + // Term -> S13 pub fn __state24< 'ast, __TOKENS: Iterator>, @@ -1217,6 +1878,27 @@ mod __parse__Expr { return Ok(__result); } + // State 25 + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // Num -> Shift(S16) + // + // Term -> S39 pub fn __state25< 'ast, __TOKENS: Iterator>, @@ -1264,6 +1946,27 @@ mod __parse__Expr { return Ok(__result); } + // State 26 + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // Num -> Shift(S16) + // + // Term -> S40 pub fn __state26< 'ast, __TOKENS: Iterator>, @@ -1311,6 +2014,23 @@ mod __parse__Expr { return Ok(__result); } + // State 27 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S41) + // "+" -> Shift(S23) + // "-" -> Shift(S24) + // pub fn __state27< 'ast, __TOKENS: Iterator>, @@ -1346,6 +2066,83 @@ mod __parse__Expr { return Ok(__result); } + // State 28 + // ( ",")+ = (*) ( ",")+ Expr "," ["("] + // ( ",")+ = (*) ( ",")+ Expr "," [")"] + // ( ",")+ = (*) ( ",")+ Expr "," ["*"] + // ( ",")+ = (*) ( ",")+ Expr "," [Num] + // ( ",")+ = (*) Expr "," ["("] + // ( ",")+ = (*) Expr "," [")"] + // ( ",")+ = (*) Expr "," ["*"] + // ( ",")+ = (*) Expr "," [Num] + // Comma = (*) [")"] + // Comma = (*) ( ",")+ [")"] + // Comma = (*) ( ",")+ Expr [")"] + // Comma = (*) Expr [")"] + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor [","] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor [","] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor [","] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Factor = "*" "(" (*) Comma ")" [")"] + // Factor = "*" "(" (*) Comma ")" ["*"] + // Factor = "*" "(" (*) Comma ")" ["+"] + // Factor = "*" "(" (*) Comma ")" ["-"] + // Factor = "*" "(" (*) Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // ")" -> Reduce(Comma = => ActionFn(23);) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // ( ",")+ -> S29 + // Comma -> S42 + // Expr -> S31 + // Factor -> S32 + // Term -> S33 pub fn __state28< 'ast, __TOKENS: Iterator>, @@ -1424,6 +2221,70 @@ mod __parse__Expr { return Ok(__result); } + // State 29 + // ( ",")+ = ( ",")+ (*) Expr "," ["("] + // ( ",")+ = ( ",")+ (*) Expr "," [")"] + // ( ",")+ = ( ",")+ (*) Expr "," ["*"] + // ( ",")+ = ( ",")+ (*) Expr "," [Num] + // Comma = ( ",")+ (*) [")"] + // Comma = ( ",")+ (*) Expr [")"] + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor [","] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor [","] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor [","] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // ")" -> Reduce(Comma = ( ",")+ => ActionFn(25);) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // Expr -> S43 + // Factor -> S32 + // Term -> S33 pub fn __state29< 'ast, __TOKENS: Iterator>, @@ -1490,6 +2351,15 @@ mod __parse__Expr { return Ok(__result); } + // State 30 + // Factor = "*" "(" Comma (*) ")" [EOF] + // Factor = "*" "(" Comma (*) ")" ["*"] + // Factor = "*" "(" Comma (*) ")" ["+"] + // Factor = "*" "(" Comma (*) ")" ["-"] + // Factor = "*" "(" Comma (*) ")" ["/"] + // + // ")" -> Shift(S44) + // pub fn __state30< 'ast, __TOKENS: Iterator>, @@ -1518,6 +2388,26 @@ mod __parse__Expr { return Ok(__result); } + // State 31 + // ( ",")+ = Expr (*) "," ["("] + // ( ",")+ = Expr (*) "," [")"] + // ( ",")+ = Expr (*) "," ["*"] + // ( ",")+ = Expr (*) "," [Num] + // Comma = Expr (*) [")"] + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor [","] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor [","] + // Expr = Expr (*) "-" Factor ["-"] + // + // ")" -> Reduce(Comma = Expr => ActionFn(22);) + // "+" -> Shift(S45) + // "," -> Shift(S46) + // "-" -> Shift(S47) + // pub fn __state31< 'ast, __TOKENS: Iterator>, @@ -1564,6 +2454,31 @@ mod __parse__Expr { return Ok(__result); } + // State 32 + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) [","] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term [","] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term [","] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S48) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "," -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S49) + // pub fn __state32< 'ast, __TOKENS: Iterator>, @@ -1609,6 +2524,21 @@ mod __parse__Expr { return Ok(__result); } + // State 33 + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) [","] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // ")" -> Reduce(Factor = Term => ActionFn(7);) + // "*" -> Reduce(Factor = Term => ActionFn(7);) + // "+" -> Reduce(Factor = Term => ActionFn(7);) + // "," -> Reduce(Factor = Term => ActionFn(7);) + // "-" -> Reduce(Factor = Term => ActionFn(7);) + // "/" -> Reduce(Factor = Term => ActionFn(7);) + // pub fn __state33< 'ast, __TOKENS: Iterator>, @@ -1647,6 +2577,60 @@ mod __parse__Expr { } } + // State 34 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" [","] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S14) + // "*" -> Shift(S15) + // Num -> Shift(S16) + // + // Expr -> S50 + // Factor -> S12 + // Term -> S13 pub fn __state34< 'ast, __TOKENS: Iterator>, @@ -1705,6 +2689,16 @@ mod __parse__Expr { return Ok(__result); } + // State 35 + // Factor = "*" (*) "(" Comma ")" [")"] + // Factor = "*" (*) "(" Comma ")" ["*"] + // Factor = "*" (*) "(" Comma ")" ["+"] + // Factor = "*" (*) "(" Comma ")" [","] + // Factor = "*" (*) "(" Comma ")" ["-"] + // Factor = "*" (*) "(" Comma ")" ["/"] + // + // "(" -> Shift(S51) + // pub fn __state35< 'ast, __TOKENS: Iterator>, @@ -1735,6 +2729,21 @@ mod __parse__Expr { return Ok(__result); } + // State 36 + // Term = Num (*) [")"] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) [","] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // ")" -> Reduce(Term = Num => ActionFn(8);) + // "*" -> Reduce(Term = Num => ActionFn(8);) + // "+" -> Reduce(Term = Num => ActionFn(8);) + // "," -> Reduce(Term = Num => ActionFn(8);) + // "-" -> Reduce(Term = Num => ActionFn(8);) + // "/" -> Reduce(Term = Num => ActionFn(8);) + // pub fn __state36< 'ast, __TOKENS: Iterator>, @@ -1777,6 +2786,27 @@ mod __parse__Expr { } } + // State 37 + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S25) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S26) + // pub fn __state37< 'ast, __TOKENS: Iterator>, @@ -1825,6 +2855,27 @@ mod __parse__Expr { return Ok(__result); } + // State 38 + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S25) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S26) + // pub fn __state38< 'ast, __TOKENS: Iterator>, @@ -1873,6 +2924,19 @@ mod __parse__Expr { return Ok(__result); } + // State 39 + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state39< 'ast, __TOKENS: Iterator>, @@ -1914,6 +2978,19 @@ mod __parse__Expr { } } + // State 40 + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state40< 'ast, __TOKENS: Iterator>, @@ -1955,6 +3032,19 @@ mod __parse__Expr { } } + // State 41 + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // pub fn __state41< 'ast, __TOKENS: Iterator>, @@ -2000,6 +3090,15 @@ mod __parse__Expr { } } + // State 42 + // Factor = "*" "(" Comma (*) ")" [")"] + // Factor = "*" "(" Comma (*) ")" ["*"] + // Factor = "*" "(" Comma (*) ")" ["+"] + // Factor = "*" "(" Comma (*) ")" ["-"] + // Factor = "*" "(" Comma (*) ")" ["/"] + // + // ")" -> Shift(S52) + // pub fn __state42< 'ast, __TOKENS: Iterator>, @@ -2028,6 +3127,26 @@ mod __parse__Expr { return Ok(__result); } + // State 43 + // ( ",")+ = ( ",")+ Expr (*) "," ["("] + // ( ",")+ = ( ",")+ Expr (*) "," [")"] + // ( ",")+ = ( ",")+ Expr (*) "," ["*"] + // ( ",")+ = ( ",")+ Expr (*) "," [Num] + // Comma = ( ",")+ Expr (*) [")"] + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor [","] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor [","] + // Expr = Expr (*) "-" Factor ["-"] + // + // ")" -> Reduce(Comma = ( ",")+, Expr => ActionFn(24);) + // "+" -> Shift(S45) + // "," -> Shift(S53) + // "-" -> Shift(S47) + // pub fn __state43< 'ast, __TOKENS: Iterator>, @@ -2076,6 +3195,19 @@ mod __parse__Expr { return Ok(__result); } + // State 44 + // Factor = "*" "(" Comma ")" (*) [EOF] + // Factor = "*" "(" Comma ")" (*) ["*"] + // Factor = "*" "(" Comma ")" (*) ["+"] + // Factor = "*" "(" Comma ")" (*) ["-"] + // Factor = "*" "(" Comma ")" (*) ["/"] + // + // EOF -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "*" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "+" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "-" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "/" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // pub fn __state44< 'ast, __TOKENS: Iterator>, @@ -2123,6 +3255,54 @@ mod __parse__Expr { } } + // State 45 + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor [","] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // Factor -> S54 + // Term -> S33 pub fn __state45< 'ast, __TOKENS: Iterator>, @@ -2178,6 +3358,17 @@ mod __parse__Expr { return Ok(__result); } + // State 46 + // ( ",")+ = Expr "," (*) ["("] + // ( ",")+ = Expr "," (*) [")"] + // ( ",")+ = Expr "," (*) ["*"] + // ( ",")+ = Expr "," (*) [Num] + // + // "(" -> Reduce(( ",")+ = Expr, "," => ActionFn(18);) + // ")" -> Reduce(( ",")+ = Expr, "," => ActionFn(18);) + // "*" -> Reduce(( ",")+ = Expr, "," => ActionFn(18);) + // Num -> Reduce(( ",")+ = Expr, "," => ActionFn(18);) + // pub fn __state46< 'ast, __TOKENS: Iterator>, @@ -2220,6 +3411,54 @@ mod __parse__Expr { } } + // State 47 + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor [","] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // Factor -> S55 + // Term -> S33 pub fn __state47< 'ast, __TOKENS: Iterator>, @@ -2275,6 +3514,30 @@ mod __parse__Expr { return Ok(__result); } + // State 48 + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term [","] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // Num -> Shift(S36) + // + // Term -> S56 pub fn __state48< 'ast, __TOKENS: Iterator>, @@ -2322,6 +3585,30 @@ mod __parse__Expr { return Ok(__result); } + // State 49 + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term [","] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // Num -> Shift(S36) + // + // Term -> S57 pub fn __state49< 'ast, __TOKENS: Iterator>, @@ -2369,6 +3656,24 @@ mod __parse__Expr { return Ok(__result); } + // State 50 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" [","] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S58) + // "+" -> Shift(S23) + // "-" -> Shift(S24) + // pub fn __state50< 'ast, __TOKENS: Iterator>, @@ -2404,6 +3709,84 @@ mod __parse__Expr { return Ok(__result); } + // State 51 + // ( ",")+ = (*) ( ",")+ Expr "," ["("] + // ( ",")+ = (*) ( ",")+ Expr "," [")"] + // ( ",")+ = (*) ( ",")+ Expr "," ["*"] + // ( ",")+ = (*) ( ",")+ Expr "," [Num] + // ( ",")+ = (*) Expr "," ["("] + // ( ",")+ = (*) Expr "," [")"] + // ( ",")+ = (*) Expr "," ["*"] + // ( ",")+ = (*) Expr "," [Num] + // Comma = (*) [")"] + // Comma = (*) ( ",")+ [")"] + // Comma = (*) ( ",")+ Expr [")"] + // Comma = (*) Expr [")"] + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor [","] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor [","] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor [","] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term [","] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term [","] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term [","] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Factor = (*) "*" "(" Comma ")" [")"] + // Factor = (*) "*" "(" Comma ")" ["*"] + // Factor = (*) "*" "(" Comma ")" ["+"] + // Factor = (*) "*" "(" Comma ")" [","] + // Factor = (*) "*" "(" Comma ")" ["-"] + // Factor = (*) "*" "(" Comma ")" ["/"] + // Factor = "*" "(" (*) Comma ")" [")"] + // Factor = "*" "(" (*) Comma ")" ["*"] + // Factor = "*" "(" (*) Comma ")" ["+"] + // Factor = "*" "(" (*) Comma ")" [","] + // Factor = "*" "(" (*) Comma ")" ["-"] + // Factor = "*" "(" (*) Comma ")" ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" [","] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num [","] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S34) + // ")" -> Reduce(Comma = => ActionFn(23);) + // "*" -> Shift(S35) + // Num -> Shift(S36) + // + // ( ",")+ -> S29 + // Comma -> S59 + // Expr -> S31 + // Factor -> S32 + // Term -> S33 pub fn __state51< 'ast, __TOKENS: Iterator>, @@ -2482,6 +3865,19 @@ mod __parse__Expr { return Ok(__result); } + // State 52 + // Factor = "*" "(" Comma ")" (*) [")"] + // Factor = "*" "(" Comma ")" (*) ["*"] + // Factor = "*" "(" Comma ")" (*) ["+"] + // Factor = "*" "(" Comma ")" (*) ["-"] + // Factor = "*" "(" Comma ")" (*) ["/"] + // + // ")" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "*" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "+" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "-" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "/" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // pub fn __state52< 'ast, __TOKENS: Iterator>, @@ -2529,6 +3925,17 @@ mod __parse__Expr { } } + // State 53 + // ( ",")+ = ( ",")+ Expr "," (*) ["("] + // ( ",")+ = ( ",")+ Expr "," (*) [")"] + // ( ",")+ = ( ",")+ Expr "," (*) ["*"] + // ( ",")+ = ( ",")+ Expr "," (*) [Num] + // + // "(" -> Reduce(( ",")+ = ( ",")+, Expr, "," => ActionFn(19);) + // ")" -> Reduce(( ",")+ = ( ",")+, Expr, "," => ActionFn(19);) + // "*" -> Reduce(( ",")+ = ( ",")+, Expr, "," => ActionFn(19);) + // Num -> Reduce(( ",")+ = ( ",")+, Expr, "," => ActionFn(19);) + // pub fn __state53< 'ast, __TOKENS: Iterator>, @@ -2573,6 +3980,31 @@ mod __parse__Expr { } } + // State 54 + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) [","] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term [","] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term [","] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S48) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "," -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S49) + // pub fn __state54< 'ast, __TOKENS: Iterator>, @@ -2622,6 +4054,31 @@ mod __parse__Expr { return Ok(__result); } + // State 55 + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) [","] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term [","] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term [","] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S48) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "," -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S49) + // pub fn __state55< 'ast, __TOKENS: Iterator>, @@ -2671,6 +4128,21 @@ mod __parse__Expr { return Ok(__result); } + // State 56 + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) [","] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "," -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state56< 'ast, __TOKENS: Iterator>, @@ -2713,6 +4185,21 @@ mod __parse__Expr { } } + // State 57 + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) [","] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "," -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state57< 'ast, __TOKENS: Iterator>, @@ -2755,6 +4242,21 @@ mod __parse__Expr { } } + // State 58 + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) [","] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "," -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(9);) + // pub fn __state58< 'ast, __TOKENS: Iterator>, @@ -2801,6 +4303,16 @@ mod __parse__Expr { } } + // State 59 + // Factor = "*" "(" Comma (*) ")" [")"] + // Factor = "*" "(" Comma (*) ")" ["*"] + // Factor = "*" "(" Comma (*) ")" ["+"] + // Factor = "*" "(" Comma (*) ")" [","] + // Factor = "*" "(" Comma (*) ")" ["-"] + // Factor = "*" "(" Comma (*) ")" ["/"] + // + // ")" -> Shift(S60) + // pub fn __state59< 'ast, __TOKENS: Iterator>, @@ -2829,6 +4341,21 @@ mod __parse__Expr { return Ok(__result); } + // State 60 + // Factor = "*" "(" Comma ")" (*) [")"] + // Factor = "*" "(" Comma ")" (*) ["*"] + // Factor = "*" "(" Comma ")" (*) ["+"] + // Factor = "*" "(" Comma ")" (*) [","] + // Factor = "*" "(" Comma ")" (*) ["-"] + // Factor = "*" "(" Comma ")" (*) ["/"] + // + // ")" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "*" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "+" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "," -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "-" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // "/" -> Reduce(Factor = "*", "(", Comma, ")" => ActionFn(6);) + // pub fn __state60< 'ast, __TOKENS: Iterator>, diff --git a/lalrpop-test/src/expr_generic.rs b/lalrpop-test/src/expr_generic.rs index 7601ff9..4cd0641 100644 --- a/lalrpop-test/src/expr_generic.rs +++ b/lalrpop-test/src/expr_generic.rs @@ -49,6 +49,49 @@ mod __parse__Expr { ____Expr((usize, F, usize)), } + // State 0 + // Expr = (*) Expr "+" Factor [EOF] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [EOF] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [EOF] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [EOF] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // __Expr = (*) Expr [EOF] + // + // "(" -> Shift(S4) + // r#"[0-9]+"# -> Shift(S5) + // + // Expr -> S1 + // Factor -> S2 + // Term -> S3 pub fn __state0< 'input, F, @@ -99,6 +142,19 @@ mod __parse__Expr { } } + // State 1 + // Expr = Expr (*) "+" Factor [EOF] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [EOF] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // "+" -> Shift(S6) + // "-" -> Shift(S7) + // pub fn __state1< 'input, F, @@ -143,6 +199,27 @@ mod __parse__Expr { return Ok(__result); } + // State 2 + // Expr = Factor (*) [EOF] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S9) + // pub fn __state2< 'input, F, @@ -189,6 +266,19 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Factor = Term (*) [EOF] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // EOF -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state3< 'input, F, @@ -228,6 +318,53 @@ mod __parse__Expr { } } + // State 4 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [EOF] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Expr -> S10 + // Factor -> S11 + // Term -> S12 pub fn __state4< 'input, F, @@ -284,6 +421,19 @@ mod __parse__Expr { return Ok(__result); } + // State 5 + // Term = r#"[0-9]+"# (*) [EOF] + // Term = r#"[0-9]+"# (*) ["*"] + // Term = r#"[0-9]+"# (*) ["+"] + // Term = r#"[0-9]+"# (*) ["-"] + // Term = r#"[0-9]+"# (*) ["/"] + // + // EOF -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "*" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "+" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "-" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "/" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // pub fn __state5< 'input, F, @@ -327,6 +477,41 @@ mod __parse__Expr { } } + // State 6 + // Expr = Expr "+" (*) Factor [EOF] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [EOF] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S4) + // r#"[0-9]+"# -> Shift(S5) + // + // Factor -> S15 + // Term -> S3 pub fn __state6< 'input, F, @@ -380,6 +565,41 @@ mod __parse__Expr { return Ok(__result); } + // State 7 + // Expr = Expr "-" (*) Factor [EOF] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [EOF] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S4) + // r#"[0-9]+"# -> Shift(S5) + // + // Factor -> S16 + // Term -> S3 pub fn __state7< 'input, F, @@ -433,6 +653,27 @@ mod __parse__Expr { return Ok(__result); } + // State 8 + // Factor = Factor "*" (*) Term [EOF] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [EOF] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S4) + // r#"[0-9]+"# -> Shift(S5) + // + // Term -> S17 pub fn __state8< 'input, F, @@ -482,6 +723,27 @@ mod __parse__Expr { return Ok(__result); } + // State 9 + // Factor = Factor "/" (*) Term [EOF] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [EOF] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S4) + // r#"[0-9]+"# -> Shift(S5) + // + // Term -> S18 pub fn __state9< 'input, F, @@ -531,6 +793,23 @@ mod __parse__Expr { return Ok(__result); } + // State 10 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [EOF] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S19) + // "+" -> Shift(S20) + // "-" -> Shift(S21) + // pub fn __state10< 'input, F, @@ -568,6 +847,27 @@ mod __parse__Expr { return Ok(__result); } + // State 11 + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S23) + // pub fn __state11< 'input, F, @@ -614,6 +914,19 @@ mod __parse__Expr { return Ok(__result); } + // State 12 + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // ")" -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state12< 'input, F, @@ -653,6 +966,53 @@ mod __parse__Expr { } } + // State 13 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Expr -> S24 + // Factor -> S11 + // Term -> S12 pub fn __state13< 'input, F, @@ -709,6 +1069,19 @@ mod __parse__Expr { return Ok(__result); } + // State 14 + // Term = r#"[0-9]+"# (*) [")"] + // Term = r#"[0-9]+"# (*) ["*"] + // Term = r#"[0-9]+"# (*) ["+"] + // Term = r#"[0-9]+"# (*) ["-"] + // Term = r#"[0-9]+"# (*) ["/"] + // + // ")" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "*" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "+" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "-" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // "/" -> Reduce(Term = r#"[0-9]+"# => ActionFn(7);) + // pub fn __state14< 'input, F, @@ -752,6 +1125,27 @@ mod __parse__Expr { } } + // State 15 + // Expr = Expr "+" Factor (*) [EOF] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S9) + // pub fn __state15< 'input, F, @@ -802,6 +1196,27 @@ mod __parse__Expr { return Ok(__result); } + // State 16 + // Expr = Expr "-" Factor (*) [EOF] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S9) + // pub fn __state16< 'input, F, @@ -852,6 +1267,19 @@ mod __parse__Expr { return Ok(__result); } + // State 17 + // Factor = Factor "*" Term (*) [EOF] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state17< 'input, F, @@ -895,6 +1323,19 @@ mod __parse__Expr { } } + // State 18 + // Factor = Factor "/" Term (*) [EOF] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state18< 'input, F, @@ -938,6 +1379,19 @@ mod __parse__Expr { } } + // State 19 + // Term = "(" Expr ")" (*) [EOF] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // EOF -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state19< 'input, F, @@ -985,6 +1439,41 @@ mod __parse__Expr { } } + // State 20 + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Factor -> S25 + // Term -> S12 pub fn __state20< 'input, F, @@ -1038,6 +1527,41 @@ mod __parse__Expr { return Ok(__result); } + // State 21 + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Factor -> S26 + // Term -> S12 pub fn __state21< 'input, F, @@ -1091,6 +1615,27 @@ mod __parse__Expr { return Ok(__result); } + // State 22 + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Term -> S27 pub fn __state22< 'input, F, @@ -1140,6 +1685,27 @@ mod __parse__Expr { return Ok(__result); } + // State 23 + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) r#"[0-9]+"# [")"] + // Term = (*) r#"[0-9]+"# ["*"] + // Term = (*) r#"[0-9]+"# ["+"] + // Term = (*) r#"[0-9]+"# ["-"] + // Term = (*) r#"[0-9]+"# ["/"] + // + // "(" -> Shift(S13) + // r#"[0-9]+"# -> Shift(S14) + // + // Term -> S28 pub fn __state23< 'input, F, @@ -1189,6 +1755,23 @@ mod __parse__Expr { return Ok(__result); } + // State 24 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S29) + // "+" -> Shift(S20) + // "-" -> Shift(S21) + // pub fn __state24< 'input, F, @@ -1226,6 +1809,27 @@ mod __parse__Expr { return Ok(__result); } + // State 25 + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S23) + // pub fn __state25< 'input, F, @@ -1276,6 +1880,27 @@ mod __parse__Expr { return Ok(__result); } + // State 26 + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S22) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S23) + // pub fn __state26< 'input, F, @@ -1326,6 +1951,19 @@ mod __parse__Expr { return Ok(__result); } + // State 27 + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state27< 'input, F, @@ -1369,6 +2007,19 @@ mod __parse__Expr { } } + // State 28 + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state28< 'input, F, @@ -1412,6 +2063,19 @@ mod __parse__Expr { } } + // State 29 + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state29< 'input, F, diff --git a/lalrpop-test/src/expr_intern_tok.rs b/lalrpop-test/src/expr_intern_tok.rs index e6f1230..f03fdd8 100644 --- a/lalrpop-test/src/expr_intern_tok.rs +++ b/lalrpop-test/src/expr_intern_tok.rs @@ -45,6 +45,55 @@ mod __parse__Expr { ____Expr((usize, i32, usize)), } + // State 0 + // Expr = (*) Expr "+" Factor [EOF] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [EOF] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [EOF] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [EOF] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // __Expr = (*) Expr [EOF] + // + // "(" -> Shift(S5) + // r#"[0-9]+"# -> Shift(S6) + // + // Expr -> S1 + // Factor -> S2 + // Num -> S3 + // Term -> S4 pub fn __state0< 'input, __TOKENS: Iterator>>, @@ -98,6 +147,19 @@ mod __parse__Expr { } } + // State 1 + // Expr = Expr (*) "+" Factor [EOF] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [EOF] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // "+" -> Shift(S7) + // "-" -> Shift(S8) + // pub fn __state1< 'input, __TOKENS: Iterator>>, @@ -141,6 +203,27 @@ mod __parse__Expr { return Ok(__result); } + // State 2 + // Expr = Factor (*) [EOF] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S10) + // pub fn __state2< 'input, __TOKENS: Iterator>>, @@ -186,6 +269,19 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Term = Num (*) [EOF] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // EOF -> Reduce(Term = Num => ActionFn(7);) + // "*" -> Reduce(Term = Num => ActionFn(7);) + // "+" -> Reduce(Term = Num => ActionFn(7);) + // "-" -> Reduce(Term = Num => ActionFn(7);) + // "/" -> Reduce(Term = Num => ActionFn(7);) + // pub fn __state3< 'input, __TOKENS: Iterator>>, @@ -224,6 +320,19 @@ mod __parse__Expr { } } + // State 4 + // Factor = Term (*) [EOF] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // EOF -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state4< 'input, __TOKENS: Iterator>>, @@ -262,6 +371,59 @@ mod __parse__Expr { } } + // State 5 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [EOF] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Expr -> S11 + // Factor -> S12 + // Num -> S13 + // Term -> S14 pub fn __state5< 'input, __TOKENS: Iterator>>, @@ -321,6 +483,19 @@ mod __parse__Expr { return Ok(__result); } + // State 6 + // Num = r#"[0-9]+"# (*) [EOF] + // Num = r#"[0-9]+"# (*) ["*"] + // Num = r#"[0-9]+"# (*) ["+"] + // Num = r#"[0-9]+"# (*) ["-"] + // Num = r#"[0-9]+"# (*) ["/"] + // + // EOF -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "*" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "+" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "-" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "/" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // pub fn __state6< 'input, __TOKENS: Iterator>>, @@ -363,6 +538,47 @@ mod __parse__Expr { } } + // State 7 + // Expr = Expr "+" (*) Factor [EOF] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [EOF] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S5) + // r#"[0-9]+"# -> Shift(S6) + // + // Factor -> S17 + // Num -> S3 + // Term -> S4 pub fn __state7< 'input, __TOKENS: Iterator>>, @@ -419,6 +635,47 @@ mod __parse__Expr { return Ok(__result); } + // State 8 + // Expr = Expr "-" (*) Factor [EOF] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [EOF] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S5) + // r#"[0-9]+"# -> Shift(S6) + // + // Factor -> S18 + // Num -> S3 + // Term -> S4 pub fn __state8< 'input, __TOKENS: Iterator>>, @@ -475,6 +732,33 @@ mod __parse__Expr { return Ok(__result); } + // State 9 + // Factor = Factor "*" (*) Term [EOF] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [EOF] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S5) + // r#"[0-9]+"# -> Shift(S6) + // + // Num -> S3 + // Term -> S19 pub fn __state9< 'input, __TOKENS: Iterator>>, @@ -527,6 +811,33 @@ mod __parse__Expr { return Ok(__result); } + // State 10 + // Factor = Factor "/" (*) Term [EOF] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [EOF] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S5) + // r#"[0-9]+"# -> Shift(S6) + // + // Num -> S3 + // Term -> S20 pub fn __state10< 'input, __TOKENS: Iterator>>, @@ -579,6 +890,23 @@ mod __parse__Expr { return Ok(__result); } + // State 11 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [EOF] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S21) + // "+" -> Shift(S22) + // "-" -> Shift(S23) + // pub fn __state11< 'input, __TOKENS: Iterator>>, @@ -615,6 +943,27 @@ mod __parse__Expr { return Ok(__result); } + // State 12 + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S24) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S25) + // pub fn __state12< 'input, __TOKENS: Iterator>>, @@ -660,6 +1009,19 @@ mod __parse__Expr { return Ok(__result); } + // State 13 + // Term = Num (*) [")"] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // ")" -> Reduce(Term = Num => ActionFn(7);) + // "*" -> Reduce(Term = Num => ActionFn(7);) + // "+" -> Reduce(Term = Num => ActionFn(7);) + // "-" -> Reduce(Term = Num => ActionFn(7);) + // "/" -> Reduce(Term = Num => ActionFn(7);) + // pub fn __state13< 'input, __TOKENS: Iterator>>, @@ -698,6 +1060,19 @@ mod __parse__Expr { } } + // State 14 + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // ")" -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state14< 'input, __TOKENS: Iterator>>, @@ -736,6 +1111,59 @@ mod __parse__Expr { } } + // State 15 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Expr -> S26 + // Factor -> S12 + // Num -> S13 + // Term -> S14 pub fn __state15< 'input, __TOKENS: Iterator>>, @@ -795,6 +1223,19 @@ mod __parse__Expr { return Ok(__result); } + // State 16 + // Num = r#"[0-9]+"# (*) [")"] + // Num = r#"[0-9]+"# (*) ["*"] + // Num = r#"[0-9]+"# (*) ["+"] + // Num = r#"[0-9]+"# (*) ["-"] + // Num = r#"[0-9]+"# (*) ["/"] + // + // ")" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "*" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "+" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "-" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // "/" -> Reduce(Num = r#"[0-9]+"# => ActionFn(9);) + // pub fn __state16< 'input, __TOKENS: Iterator>>, @@ -837,6 +1278,27 @@ mod __parse__Expr { } } + // State 17 + // Expr = Expr "+" Factor (*) [EOF] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S10) + // pub fn __state17< 'input, __TOKENS: Iterator>>, @@ -886,6 +1348,27 @@ mod __parse__Expr { return Ok(__result); } + // State 18 + // Expr = Expr "-" Factor (*) [EOF] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S9) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S10) + // pub fn __state18< 'input, __TOKENS: Iterator>>, @@ -935,6 +1418,19 @@ mod __parse__Expr { return Ok(__result); } + // State 19 + // Factor = Factor "*" Term (*) [EOF] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state19< 'input, __TOKENS: Iterator>>, @@ -977,6 +1473,19 @@ mod __parse__Expr { } } + // State 20 + // Factor = Factor "/" Term (*) [EOF] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state20< 'input, __TOKENS: Iterator>>, @@ -1019,6 +1528,19 @@ mod __parse__Expr { } } + // State 21 + // Term = "(" Expr ")" (*) [EOF] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // EOF -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state21< 'input, __TOKENS: Iterator>>, @@ -1065,6 +1587,47 @@ mod __parse__Expr { } } + // State 22 + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Factor -> S27 + // Num -> S13 + // Term -> S14 pub fn __state22< 'input, __TOKENS: Iterator>>, @@ -1121,6 +1684,47 @@ mod __parse__Expr { return Ok(__result); } + // State 23 + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Factor -> S28 + // Num -> S13 + // Term -> S14 pub fn __state23< 'input, __TOKENS: Iterator>>, @@ -1177,6 +1781,33 @@ mod __parse__Expr { return Ok(__result); } + // State 24 + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Num -> S13 + // Term -> S29 pub fn __state24< 'input, __TOKENS: Iterator>>, @@ -1229,6 +1860,33 @@ mod __parse__Expr { return Ok(__result); } + // State 25 + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Num = (*) r#"[0-9]+"# [")"] + // Num = (*) r#"[0-9]+"# ["*"] + // Num = (*) r#"[0-9]+"# ["+"] + // Num = (*) r#"[0-9]+"# ["-"] + // Num = (*) r#"[0-9]+"# ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // + // "(" -> Shift(S15) + // r#"[0-9]+"# -> Shift(S16) + // + // Num -> S13 + // Term -> S30 pub fn __state25< 'input, __TOKENS: Iterator>>, @@ -1281,6 +1939,23 @@ mod __parse__Expr { return Ok(__result); } + // State 26 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S31) + // "+" -> Shift(S22) + // "-" -> Shift(S23) + // pub fn __state26< 'input, __TOKENS: Iterator>>, @@ -1317,6 +1992,27 @@ mod __parse__Expr { return Ok(__result); } + // State 27 + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S24) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S25) + // pub fn __state27< 'input, __TOKENS: Iterator>>, @@ -1366,6 +2062,27 @@ mod __parse__Expr { return Ok(__result); } + // State 28 + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S24) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S25) + // pub fn __state28< 'input, __TOKENS: Iterator>>, @@ -1415,6 +2132,19 @@ mod __parse__Expr { return Ok(__result); } + // State 29 + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state29< 'input, __TOKENS: Iterator>>, @@ -1457,6 +2187,19 @@ mod __parse__Expr { } } + // State 30 + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state30< 'input, __TOKENS: Iterator>>, @@ -1499,6 +2242,19 @@ mod __parse__Expr { } } + // State 31 + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state31< 'input, __TOKENS: Iterator>>, diff --git a/lalrpop-test/src/expr_lalr.rs b/lalrpop-test/src/expr_lalr.rs index 3d8539c..6ebc5f6 100644 --- a/lalrpop-test/src/expr_lalr.rs +++ b/lalrpop-test/src/expr_lalr.rs @@ -45,6 +45,49 @@ mod __parse__Expr { ____Expr(((), i32, ())), } + // State 0 + // Expr = (*) Expr "+" Factor [EOF] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [EOF] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [EOF] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // __Expr = (*) Expr [EOF] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Expr -> S1 + // Factor -> S2 + // Term -> S3 pub fn __state0< __TOKENS: Iterator>, >( @@ -92,6 +135,19 @@ mod __parse__Expr { } } + // State 1 + // Expr = Expr (*) "+" Factor [EOF] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [EOF] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // "+" -> Shift(S6) + // "-" -> Shift(S7) + // pub fn __state1< __TOKENS: Iterator>, >( @@ -133,6 +189,41 @@ mod __parse__Expr { return Ok(__result); } + // State 2 + // Expr = Factor (*) [EOF] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // Expr = Factor (*) [")"] + // Expr = Factor (*) ["+"] + // Expr = Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Factor => ActionFn(3);) + // ")" -> Reduce(Expr = Factor => ActionFn(3);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Factor => ActionFn(3);) + // "-" -> Reduce(Expr = Factor => ActionFn(3);) + // "/" -> Shift(S9) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -177,6 +268,25 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Factor = Term (*) [EOF] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // Factor = Term (*) [")"] + // Factor = Term (*) ["*"] + // Factor = Term (*) ["+"] + // Factor = Term (*) ["-"] + // Factor = Term (*) ["/"] + // + // EOF -> Reduce(Factor = Term => ActionFn(6);) + // ")" -> Reduce(Factor = Term => ActionFn(6);) + // "*" -> Reduce(Factor = Term => ActionFn(6);) + // "+" -> Reduce(Factor = Term => ActionFn(6);) + // "-" -> Reduce(Factor = Term => ActionFn(6);) + // "/" -> Reduce(Factor = Term => ActionFn(6);) + // pub fn __state3< __TOKENS: Iterator>, >( @@ -214,6 +324,92 @@ mod __parse__Expr { } } + // State 4 + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [EOF] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Expr = (*) Expr "+" Factor [")"] + // Expr = (*) Expr "+" Factor ["+"] + // Expr = (*) Expr "+" Factor ["-"] + // Expr = (*) Expr "-" Factor [")"] + // Expr = (*) Expr "-" Factor ["+"] + // Expr = (*) Expr "-" Factor ["-"] + // Expr = (*) Factor [")"] + // Expr = (*) Factor ["+"] + // Expr = (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = "(" (*) Expr ")" [")"] + // Term = "(" (*) Expr ")" ["*"] + // Term = "(" (*) Expr ")" ["+"] + // Term = "(" (*) Expr ")" ["-"] + // Term = "(" (*) Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Expr -> S10 + // Factor -> S2 + // Term -> S3 pub fn __state4< __TOKENS: Iterator>, >( @@ -267,6 +463,25 @@ mod __parse__Expr { return Ok(__result); } + // State 5 + // Term = Num (*) [EOF] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // Term = Num (*) [")"] + // Term = Num (*) ["*"] + // Term = Num (*) ["+"] + // Term = Num (*) ["-"] + // Term = Num (*) ["/"] + // + // EOF -> Reduce(Term = Num => ActionFn(7);) + // ")" -> Reduce(Term = Num => ActionFn(7);) + // "*" -> Reduce(Term = Num => ActionFn(7);) + // "+" -> Reduce(Term = Num => ActionFn(7);) + // "-" -> Reduce(Term = Num => ActionFn(7);) + // "/" -> Reduce(Term = Num => ActionFn(7);) + // pub fn __state5< __TOKENS: Iterator>, >( @@ -308,6 +523,69 @@ mod __parse__Expr { } } + // State 6 + // Expr = Expr "+" (*) Factor [EOF] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Expr = Expr "+" (*) Factor [")"] + // Expr = Expr "+" (*) Factor ["+"] + // Expr = Expr "+" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Factor -> S11 + // Term -> S3 pub fn __state6< __TOKENS: Iterator>, >( @@ -358,6 +636,69 @@ mod __parse__Expr { return Ok(__result); } + // State 7 + // Expr = Expr "-" (*) Factor [EOF] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [EOF] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [EOF] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [EOF] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Expr = Expr "-" (*) Factor [")"] + // Expr = Expr "-" (*) Factor ["+"] + // Expr = Expr "-" (*) Factor ["-"] + // Factor = (*) Factor "*" Term [")"] + // Factor = (*) Factor "*" Term ["*"] + // Factor = (*) Factor "*" Term ["+"] + // Factor = (*) Factor "*" Term ["-"] + // Factor = (*) Factor "*" Term ["/"] + // Factor = (*) Factor "/" Term [")"] + // Factor = (*) Factor "/" Term ["*"] + // Factor = (*) Factor "/" Term ["+"] + // Factor = (*) Factor "/" Term ["-"] + // Factor = (*) Factor "/" Term ["/"] + // Factor = (*) Term [")"] + // Factor = (*) Term ["*"] + // Factor = (*) Term ["+"] + // Factor = (*) Term ["-"] + // Factor = (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Factor -> S12 + // Term -> S3 pub fn __state7< __TOKENS: Iterator>, >( @@ -408,6 +749,42 @@ mod __parse__Expr { return Ok(__result); } + // State 8 + // Factor = Factor "*" (*) Term [EOF] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Factor = Factor "*" (*) Term [")"] + // Factor = Factor "*" (*) Term ["*"] + // Factor = Factor "*" (*) Term ["+"] + // Factor = Factor "*" (*) Term ["-"] + // Factor = Factor "*" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Term -> S13 pub fn __state8< __TOKENS: Iterator>, >( @@ -454,6 +831,42 @@ mod __parse__Expr { return Ok(__result); } + // State 9 + // Factor = Factor "/" (*) Term [EOF] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [EOF] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [EOF] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // Factor = Factor "/" (*) Term [")"] + // Factor = Factor "/" (*) Term ["*"] + // Factor = Factor "/" (*) Term ["+"] + // Factor = Factor "/" (*) Term ["-"] + // Factor = Factor "/" (*) Term ["/"] + // Term = (*) "(" Expr ")" [")"] + // Term = (*) "(" Expr ")" ["*"] + // Term = (*) "(" Expr ")" ["+"] + // Term = (*) "(" Expr ")" ["-"] + // Term = (*) "(" Expr ")" ["/"] + // Term = (*) Num [")"] + // Term = (*) Num ["*"] + // Term = (*) Num ["+"] + // Term = (*) Num ["-"] + // Term = (*) Num ["/"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // Term -> S14 pub fn __state9< __TOKENS: Iterator>, >( @@ -500,6 +913,34 @@ mod __parse__Expr { return Ok(__result); } + // State 10 + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [EOF] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // Expr = Expr (*) "+" Factor [")"] + // Expr = Expr (*) "+" Factor ["+"] + // Expr = Expr (*) "+" Factor ["-"] + // Expr = Expr (*) "-" Factor [")"] + // Expr = Expr (*) "-" Factor ["+"] + // Expr = Expr (*) "-" Factor ["-"] + // Term = "(" Expr (*) ")" [")"] + // Term = "(" Expr (*) ")" ["*"] + // Term = "(" Expr (*) ")" ["+"] + // Term = "(" Expr (*) ")" ["-"] + // Term = "(" Expr (*) ")" ["/"] + // + // ")" -> Shift(S15) + // "+" -> Shift(S6) + // "-" -> Shift(S7) + // pub fn __state10< __TOKENS: Iterator>, >( @@ -534,6 +975,41 @@ mod __parse__Expr { return Ok(__result); } + // State 11 + // Expr = Expr "+" Factor (*) [EOF] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // Expr = Expr "+" Factor (*) [")"] + // Expr = Expr "+" Factor (*) ["+"] + // Expr = Expr "+" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // ")" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "-" -> Reduce(Expr = Expr, "+", Factor => ActionFn(2);) + // "/" -> Shift(S9) + // pub fn __state11< __TOKENS: Iterator>, >( @@ -582,6 +1058,41 @@ mod __parse__Expr { return Ok(__result); } + // State 12 + // Expr = Expr "-" Factor (*) [EOF] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [EOF] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [EOF] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // Expr = Expr "-" Factor (*) [")"] + // Expr = Expr "-" Factor (*) ["+"] + // Expr = Expr "-" Factor (*) ["-"] + // Factor = Factor (*) "*" Term [")"] + // Factor = Factor (*) "*" Term ["*"] + // Factor = Factor (*) "*" Term ["+"] + // Factor = Factor (*) "*" Term ["-"] + // Factor = Factor (*) "*" Term ["/"] + // Factor = Factor (*) "/" Term [")"] + // Factor = Factor (*) "/" Term ["*"] + // Factor = Factor (*) "/" Term ["+"] + // Factor = Factor (*) "/" Term ["-"] + // Factor = Factor (*) "/" Term ["/"] + // + // EOF -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // ")" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "*" -> Shift(S8) + // "+" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "-" -> Reduce(Expr = Expr, "-", Factor => ActionFn(1);) + // "/" -> Shift(S9) + // pub fn __state12< __TOKENS: Iterator>, >( @@ -630,6 +1141,25 @@ mod __parse__Expr { return Ok(__result); } + // State 13 + // Factor = Factor "*" Term (*) [EOF] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // Factor = Factor "*" Term (*) [")"] + // Factor = Factor "*" Term (*) ["*"] + // Factor = Factor "*" Term (*) ["+"] + // Factor = Factor "*" Term (*) ["-"] + // Factor = Factor "*" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // ")" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "*" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "+" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "-" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // "/" -> Reduce(Factor = Factor, "*", Term => ActionFn(4);) + // pub fn __state13< __TOKENS: Iterator>, >( @@ -671,6 +1201,25 @@ mod __parse__Expr { } } + // State 14 + // Factor = Factor "/" Term (*) [EOF] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // Factor = Factor "/" Term (*) [")"] + // Factor = Factor "/" Term (*) ["*"] + // Factor = Factor "/" Term (*) ["+"] + // Factor = Factor "/" Term (*) ["-"] + // Factor = Factor "/" Term (*) ["/"] + // + // EOF -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // ")" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "*" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "+" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "-" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // "/" -> Reduce(Factor = Factor, "/", Term => ActionFn(5);) + // pub fn __state14< __TOKENS: Iterator>, >( @@ -712,6 +1261,25 @@ mod __parse__Expr { } } + // State 15 + // Term = "(" Expr ")" (*) [EOF] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // Term = "(" Expr ")" (*) [")"] + // Term = "(" Expr ")" (*) ["*"] + // Term = "(" Expr ")" (*) ["+"] + // Term = "(" Expr ")" (*) ["-"] + // Term = "(" Expr ")" (*) ["/"] + // + // EOF -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // ")" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "*" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "+" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "-" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // "/" -> Reduce(Term = "(", Expr, ")" => ActionFn(8);) + // pub fn __state15< __TOKENS: Iterator>, >( diff --git a/lalrpop-test/src/inline.rs b/lalrpop-test/src/inline.rs index 7f25803..f9ede3e 100644 --- a/lalrpop-test/src/inline.rs +++ b/lalrpop-test/src/inline.rs @@ -39,6 +39,16 @@ mod __parse__E { ____E((usize, String, usize)), } + // State 0 + // E = (*) "&" E [EOF] + // E = (*) "&" "L" E [EOF] + // E = (*) "L" [EOF] + // __E = (*) E [EOF] + // + // "&" -> Shift(S2) + // "L" -> Shift(S3) + // + // E -> S1 pub fn __state0< 'input, __TOKENS: Iterator>>, @@ -79,6 +89,11 @@ mod __parse__E { } } + // State 1 + // __E = E (*) [EOF] + // + // EOF -> Reduce(__E = E => ActionFn(0);) + // pub fn __state1< 'input, __TOKENS: Iterator>>, @@ -112,6 +127,17 @@ mod __parse__E { } } + // State 2 + // E = (*) "&" E [EOF] + // E = "&" (*) E [EOF] + // E = (*) "&" "L" E [EOF] + // E = "&" (*) "L" E [EOF] + // E = (*) "L" [EOF] + // + // "&" -> Shift(S2) + // "L" -> Shift(S5) + // + // E -> S4 pub fn __state2< 'input, __TOKENS: Iterator>>, @@ -158,6 +184,11 @@ mod __parse__E { return Ok(__result); } + // State 3 + // E = "L" (*) [EOF] + // + // EOF -> Reduce(E = "L" => ActionFn(1);) + // pub fn __state3< 'input, __TOKENS: Iterator>>, @@ -195,6 +226,11 @@ mod __parse__E { } } + // State 4 + // E = "&" E (*) [EOF] + // + // EOF -> Reduce(E = "&", E => ActionFn(7);) + // pub fn __state4< 'input, __TOKENS: Iterator>>, @@ -230,6 +266,18 @@ mod __parse__E { } } + // State 5 + // E = (*) "&" E [EOF] + // E = (*) "&" "L" E [EOF] + // E = "&" "L" (*) E [EOF] + // E = (*) "L" [EOF] + // E = "L" (*) [EOF] + // + // EOF -> Reduce(E = "L" => ActionFn(1);) + // "&" -> Shift(S2) + // "L" -> Shift(S3) + // + // E -> S6 pub fn __state5< 'input, __TOKENS: Iterator>>, @@ -289,6 +337,11 @@ mod __parse__E { return Ok(__result); } + // State 6 + // E = "&" "L" E (*) [EOF] + // + // EOF -> Reduce(E = "&", "L", E => ActionFn(8);) + // pub fn __state6< 'input, __TOKENS: Iterator>>, diff --git a/lalrpop-test/src/intern_tok.rs b/lalrpop-test/src/intern_tok.rs index 0cb6c11..6a3f767 100644 --- a/lalrpop-test/src/intern_tok.rs +++ b/lalrpop-test/src/intern_tok.rs @@ -42,6 +42,23 @@ mod __parse__Items { ____Items((usize, Vec<(usize, usize)>, usize)), } + // State 0 + // Items = (*) [EOF] + // Items = (*) ["+"] + // Items = (*) ["-"] + // Items = (*) Items Spanned<"+"> [EOF] + // Items = (*) Items Spanned<"+"> ["+"] + // Items = (*) Items Spanned<"+"> ["-"] + // Items = (*) Items "-" [EOF] + // Items = (*) Items "-" ["+"] + // Items = (*) Items "-" ["-"] + // __Items = (*) Items [EOF] + // + // EOF -> Reduce(Items = => ActionFn(9);) + // "+" -> Reduce(Items = => ActionFn(9);) + // "-" -> Reduce(Items = => ActionFn(9);) + // + // Items -> S1 pub fn __state0< 'input, __TOKENS: Iterator>>, @@ -87,6 +104,23 @@ mod __parse__Items { } } + // State 1 + // Items = Items (*) Spanned<"+"> [EOF] + // Items = Items (*) Spanned<"+"> ["+"] + // Items = Items (*) Spanned<"+"> ["-"] + // Items = Items (*) "-" [EOF] + // Items = Items (*) "-" ["+"] + // Items = Items (*) "-" ["-"] + // Spanned<"+"> = (*) "+" [EOF] + // Spanned<"+"> = (*) "+" ["+"] + // Spanned<"+"> = (*) "+" ["-"] + // __Items = Items (*) [EOF] + // + // EOF -> Reduce(__Items = Items => ActionFn(0);) + // "+" -> Shift(S3) + // "-" -> Shift(S4) + // + // Spanned<"+"> -> S2 pub fn __state1< 'input, __TOKENS: Iterator>>, @@ -141,6 +175,15 @@ mod __parse__Items { return Ok(__result); } + // State 2 + // Items = Items Spanned<"+"> (*) [EOF] + // Items = Items Spanned<"+"> (*) ["+"] + // Items = Items Spanned<"+"> (*) ["-"] + // + // EOF -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // "+" -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // "-" -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // pub fn __state2< 'input, __TOKENS: Iterator>>, @@ -178,6 +221,15 @@ mod __parse__Items { } } + // State 3 + // Spanned<"+"> = "+" (*) [EOF] + // Spanned<"+"> = "+" (*) ["+"] + // Spanned<"+"> = "+" (*) ["-"] + // + // EOF -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // "+" -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // "-" -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // pub fn __state3< 'input, __TOKENS: Iterator>>, @@ -217,6 +269,15 @@ mod __parse__Items { } } + // State 4 + // Items = Items "-" (*) [EOF] + // Items = Items "-" (*) ["+"] + // Items = Items "-" (*) ["-"] + // + // EOF -> Reduce(Items = Items, "-" => ActionFn(3);) + // "+" -> Reduce(Items = Items, "-" => ActionFn(3);) + // "-" -> Reduce(Items = Items, "-" => ActionFn(3);) + // pub fn __state4< 'input, __TOKENS: Iterator>>, diff --git a/lalrpop-test/src/lifetime_tok.rs b/lalrpop-test/src/lifetime_tok.rs index 0082eef..2a7418a 100644 --- a/lalrpop-test/src/lifetime_tok.rs +++ b/lalrpop-test/src/lifetime_tok.rs @@ -44,6 +44,20 @@ mod __parse__Expr { ____Expr(((), Vec<&'input str>, ())), } + // State 0 + // Expr = (*) [EOF] + // Expr = (*) Other+ [EOF] + // Other+ = (*) Other+ Other [EOF] + // Other+ = (*) Other+ Other [Other] + // Other+ = (*) Other [EOF] + // Other+ = (*) Other [Other] + // __Expr = (*) Expr [EOF] + // + // EOF -> Reduce(Expr = => ActionFn(6);) + // Other -> Shift(S3) + // + // Expr -> S1 + // Other+ -> S2 pub fn __state0< 'input, __TOKENS: Iterator, ()),()>>, @@ -94,6 +108,11 @@ mod __parse__Expr { } } + // State 1 + // __Expr = Expr (*) [EOF] + // + // EOF -> Reduce(__Expr = Expr => ActionFn(0);) + // pub fn __state1< 'input, __TOKENS: Iterator, ()),()>>, @@ -126,6 +145,14 @@ mod __parse__Expr { } } + // State 2 + // Expr = Other+ (*) [EOF] + // Other+ = Other+ (*) Other [EOF] + // Other+ = Other+ (*) Other [Other] + // + // EOF -> Reduce(Expr = Other+ => ActionFn(7);) + // Other -> Shift(S4) + // pub fn __state2< 'input, __TOKENS: Iterator, ()),()>>, @@ -163,6 +190,13 @@ mod __parse__Expr { return Ok(__result); } + // State 3 + // Other+ = Other (*) [EOF] + // Other+ = Other (*) [Other] + // + // EOF -> Reduce(Other+ = Other => ActionFn(4);) + // Other -> Reduce(Other+ = Other => ActionFn(4);) + // pub fn __state3< 'input, __TOKENS: Iterator, ()),()>>, @@ -200,6 +234,13 @@ mod __parse__Expr { } } + // State 4 + // Other+ = Other+ Other (*) [EOF] + // Other+ = Other+ Other (*) [Other] + // + // EOF -> Reduce(Other+ = Other+, Other => ActionFn(5);) + // Other -> Reduce(Other+ = Other+, Other => ActionFn(5);) + // pub fn __state4< 'input, __TOKENS: Iterator, ()),()>>, diff --git a/lalrpop-test/src/loc.rs b/lalrpop-test/src/loc.rs index fb751ff..10a9734 100644 --- a/lalrpop-test/src/loc.rs +++ b/lalrpop-test/src/loc.rs @@ -44,6 +44,23 @@ mod __parse__Items { ____Items((usize, Vec<(usize, usize)>, usize)), } + // State 0 + // Items = (*) [EOF] + // Items = (*) ["+"] + // Items = (*) ["-"] + // Items = (*) Items Spanned<"+"> [EOF] + // Items = (*) Items Spanned<"+"> ["+"] + // Items = (*) Items Spanned<"+"> ["-"] + // Items = (*) Items "-" [EOF] + // Items = (*) Items "-" ["+"] + // Items = (*) Items "-" ["-"] + // __Items = (*) Items [EOF] + // + // EOF -> Reduce(Items = => ActionFn(9);) + // "+" -> Reduce(Items = => ActionFn(9);) + // "-" -> Reduce(Items = => ActionFn(9);) + // + // Items -> S1 pub fn __state0< __TOKENS: Iterator>, >( @@ -87,6 +104,23 @@ mod __parse__Items { } } + // State 1 + // Items = Items (*) Spanned<"+"> [EOF] + // Items = Items (*) Spanned<"+"> ["+"] + // Items = Items (*) Spanned<"+"> ["-"] + // Items = Items (*) "-" [EOF] + // Items = Items (*) "-" ["+"] + // Items = Items (*) "-" ["-"] + // Spanned<"+"> = (*) "+" [EOF] + // Spanned<"+"> = (*) "+" ["+"] + // Spanned<"+"> = (*) "+" ["-"] + // __Items = Items (*) [EOF] + // + // EOF -> Reduce(__Items = Items => ActionFn(0);) + // "+" -> Shift(S3) + // "-" -> Shift(S4) + // + // Spanned<"+"> -> S2 pub fn __state1< __TOKENS: Iterator>, >( @@ -139,6 +173,15 @@ mod __parse__Items { return Ok(__result); } + // State 2 + // Items = Items Spanned<"+"> (*) [EOF] + // Items = Items Spanned<"+"> (*) ["+"] + // Items = Items Spanned<"+"> (*) ["-"] + // + // EOF -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // "+" -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // "-" -> Reduce(Items = Items, Spanned<"+"> => ActionFn(2);) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -174,6 +217,15 @@ mod __parse__Items { } } + // State 3 + // Spanned<"+"> = "+" (*) [EOF] + // Spanned<"+"> = "+" (*) ["+"] + // Spanned<"+"> = "+" (*) ["-"] + // + // EOF -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // "+" -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // "-" -> Reduce(Spanned<"+"> = "+" => ActionFn(10);) + // pub fn __state3< __TOKENS: Iterator>, >( @@ -211,6 +263,15 @@ mod __parse__Items { } } + // State 4 + // Items = Items "-" (*) [EOF] + // Items = Items "-" (*) ["+"] + // Items = Items "-" (*) ["-"] + // + // EOF -> Reduce(Items = Items, "-" => ActionFn(3);) + // "+" -> Reduce(Items = Items, "-" => ActionFn(3);) + // "-" -> Reduce(Items = Items, "-" => ActionFn(3);) + // pub fn __state4< __TOKENS: Iterator>, >( diff --git a/lalrpop-test/src/loc_issue_90.rs b/lalrpop-test/src/loc_issue_90.rs index fe96538..5bdee7f 100644 --- a/lalrpop-test/src/loc_issue_90.rs +++ b/lalrpop-test/src/loc_issue_90.rs @@ -46,6 +46,34 @@ mod __parse__Expression2 { ____Expression2((usize, Box>, usize)), } + // State 0 + // Expression1 = (*) Wacky [EOF] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [EOF] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [EOF] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [EOF] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [EOF] + // Expression1 = (*) r#"\\w+"# ["*"] + // Expression2 = (*) Expression1 [EOF] + // Expression2 = (*) Expression1 ["*"] + // Expression2 = (*) Expression2 Expression2Op Expression1 [EOF] + // Expression2 = (*) Expression2 Expression2Op Expression1 ["*"] + // Wacky = (*) "wacky" [EOF] + // Wacky = (*) "wacky" ["*"] + // __Expression2 = (*) Expression2 [EOF] + // + // "&" -> Shift(S4) + // "(" -> Shift(S5) + // "wacky" -> Shift(S6) + // "wonky" -> Shift(S7) + // r#"\\w+"# -> Shift(S8) + // + // Expression1 -> S1 + // Expression2 -> S2 + // Wacky -> S3 pub fn __state0< 'input, __TOKENS: Iterator>>, @@ -106,6 +134,13 @@ mod __parse__Expression2 { } } + // State 1 + // Expression2 = Expression1 (*) [EOF] + // Expression2 = Expression1 (*) ["*"] + // + // EOF -> Reduce(Expression2 = Expression1 => ActionFn(29);) + // "*" -> Reduce(Expression2 = Expression1 => ActionFn(29);) + // pub fn __state1< 'input, __TOKENS: Iterator>>, @@ -140,6 +175,20 @@ mod __parse__Expression2 { } } + // State 2 + // Expression2 = Expression2 (*) Expression2Op Expression1 [EOF] + // Expression2 = Expression2 (*) Expression2Op Expression1 ["*"] + // Expression2Op = (*) "*" ["&"] + // Expression2Op = (*) "*" ["("] + // Expression2Op = (*) "*" ["wacky"] + // Expression2Op = (*) "*" ["wonky"] + // Expression2Op = (*) "*" [r#"\\w+"#] + // __Expression2 = Expression2 (*) [EOF] + // + // EOF -> Reduce(__Expression2 = Expression2 => ActionFn(0);) + // "*" -> Shift(S10) + // + // Expression2Op -> S9 pub fn __state2< 'input, __TOKENS: Iterator>>, @@ -190,6 +239,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 3 + // Expression1 = Wacky (*) [EOF] + // Expression1 = Wacky (*) ["*"] + // + // EOF -> Reduce(Expression1 = Wacky => ActionFn(8);) + // "*" -> Reduce(Expression1 = Wacky => ActionFn(8);) + // pub fn __state3< 'input, __TOKENS: Iterator>>, @@ -224,6 +280,28 @@ mod __parse__Expression2 { } } + // State 4 + // Expression1 = "&" (*) Maybe Expression1 [EOF] + // Expression1 = "&" (*) Maybe Expression1 ["*"] + // Maybe = (*) ["&"] + // Maybe = (*) ["("] + // Maybe = (*) ["wacky"] + // Maybe = (*) ["wonky"] + // Maybe = (*) [r#"\\w+"#] + // Maybe = (*) "[" "]" ["&"] + // Maybe = (*) "[" "]" ["("] + // Maybe = (*) "[" "]" ["wacky"] + // Maybe = (*) "[" "]" ["wonky"] + // Maybe = (*) "[" "]" [r#"\\w+"#] + // + // "&" -> Reduce(Maybe = => ActionFn(31);) + // "(" -> Reduce(Maybe = => ActionFn(31);) + // "[" -> Shift(S12) + // "wacky" -> Reduce(Maybe = => ActionFn(31);) + // "wonky" -> Reduce(Maybe = => ActionFn(31);) + // r#"\\w+"# -> Reduce(Maybe = => ActionFn(31);) + // + // Maybe -> S11 pub fn __state4< 'input, __TOKENS: Iterator>>, @@ -281,6 +359,35 @@ mod __parse__Expression2 { return Ok(__result); } + // State 5 + // Expression1 = (*) Wacky [")"] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [")"] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [")"] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = "(" (*) Expression2 ")" [EOF] + // Expression1 = "(" (*) Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [")"] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [")"] + // Expression1 = (*) r#"\\w+"# ["*"] + // Expression2 = (*) Expression1 [")"] + // Expression2 = (*) Expression1 ["*"] + // Expression2 = (*) Expression2 Expression2Op Expression1 [")"] + // Expression2 = (*) Expression2 Expression2Op Expression1 ["*"] + // Wacky = (*) "wacky" [")"] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S16) + // "(" -> Shift(S17) + // "wacky" -> Shift(S18) + // "wonky" -> Shift(S19) + // r#"\\w+"# -> Shift(S20) + // + // Expression1 -> S13 + // Expression2 -> S14 + // Wacky -> S15 pub fn __state5< 'input, __TOKENS: Iterator>>, @@ -347,6 +454,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 6 + // Wacky = "wacky" (*) [EOF] + // Wacky = "wacky" (*) ["*"] + // + // EOF -> Reduce(Wacky = "wacky" => ActionFn(33);) + // "*" -> Reduce(Wacky = "wacky" => ActionFn(33);) + // pub fn __state6< 'input, __TOKENS: Iterator>>, @@ -385,6 +499,16 @@ mod __parse__Expression2 { } } + // State 7 + // Expression1 = "wonky" (*) Wonky [EOF] + // Expression1 = "wonky" (*) Wonky ["*"] + // Wonky = (*) [EOF] + // Wonky = (*) ["*"] + // + // EOF -> Reduce(Wonky = => ActionFn(34);) + // "*" -> Reduce(Wonky = => ActionFn(34);) + // + // Wonky -> S21 pub fn __state7< 'input, __TOKENS: Iterator>>, @@ -435,6 +559,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 8 + // Expression1 = r#"\\w+"# (*) [EOF] + // Expression1 = r#"\\w+"# (*) ["*"] + // + // EOF -> Reduce(Expression1 = r#"\\w+"# => ActionFn(26);) + // "*" -> Reduce(Expression1 = r#"\\w+"# => ActionFn(26);) + // pub fn __state8< 'input, __TOKENS: Iterator>>, @@ -473,6 +604,30 @@ mod __parse__Expression2 { } } + // State 9 + // Expression1 = (*) Wacky [EOF] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [EOF] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [EOF] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [EOF] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [EOF] + // Expression1 = (*) r#"\\w+"# ["*"] + // Expression2 = Expression2 Expression2Op (*) Expression1 [EOF] + // Expression2 = Expression2 Expression2Op (*) Expression1 ["*"] + // Wacky = (*) "wacky" [EOF] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S4) + // "(" -> Shift(S5) + // "wacky" -> Shift(S6) + // "wonky" -> Shift(S7) + // r#"\\w+"# -> Shift(S8) + // + // Expression1 -> S22 + // Wacky -> S3 pub fn __state9< 'input, __TOKENS: Iterator>>, @@ -532,6 +687,19 @@ mod __parse__Expression2 { return Ok(__result); } + // State 10 + // Expression2Op = "*" (*) ["&"] + // Expression2Op = "*" (*) ["("] + // Expression2Op = "*" (*) ["wacky"] + // Expression2Op = "*" (*) ["wonky"] + // Expression2Op = "*" (*) [r#"\\w+"#] + // + // "&" -> Reduce(Expression2Op = "*" => ActionFn(30);) + // "(" -> Reduce(Expression2Op = "*" => ActionFn(30);) + // "wacky" -> Reduce(Expression2Op = "*" => ActionFn(30);) + // "wonky" -> Reduce(Expression2Op = "*" => ActionFn(30);) + // r#"\\w+"# -> Reduce(Expression2Op = "*" => ActionFn(30);) + // pub fn __state10< 'input, __TOKENS: Iterator>>, @@ -573,6 +741,30 @@ mod __parse__Expression2 { } } + // State 11 + // Expression1 = (*) Wacky [EOF] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [EOF] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = "&" Maybe (*) Expression1 [EOF] + // Expression1 = "&" Maybe (*) Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [EOF] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [EOF] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [EOF] + // Expression1 = (*) r#"\\w+"# ["*"] + // Wacky = (*) "wacky" [EOF] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S4) + // "(" -> Shift(S5) + // "wacky" -> Shift(S6) + // "wonky" -> Shift(S7) + // r#"\\w+"# -> Shift(S8) + // + // Expression1 -> S23 + // Wacky -> S3 pub fn __state11< 'input, __TOKENS: Iterator>>, @@ -632,6 +824,15 @@ mod __parse__Expression2 { return Ok(__result); } + // State 12 + // Maybe = "[" (*) "]" ["&"] + // Maybe = "[" (*) "]" ["("] + // Maybe = "[" (*) "]" ["wacky"] + // Maybe = "[" (*) "]" ["wonky"] + // Maybe = "[" (*) "]" [r#"\\w+"#] + // + // "]" -> Shift(S24) + // pub fn __state12< 'input, __TOKENS: Iterator>>, @@ -662,6 +863,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 13 + // Expression2 = Expression1 (*) [")"] + // Expression2 = Expression1 (*) ["*"] + // + // ")" -> Reduce(Expression2 = Expression1 => ActionFn(29);) + // "*" -> Reduce(Expression2 = Expression1 => ActionFn(29);) + // pub fn __state13< 'input, __TOKENS: Iterator>>, @@ -696,6 +904,21 @@ mod __parse__Expression2 { } } + // State 14 + // Expression1 = "(" Expression2 (*) ")" [EOF] + // Expression1 = "(" Expression2 (*) ")" ["*"] + // Expression2 = Expression2 (*) Expression2Op Expression1 [")"] + // Expression2 = Expression2 (*) Expression2Op Expression1 ["*"] + // Expression2Op = (*) "*" ["&"] + // Expression2Op = (*) "*" ["("] + // Expression2Op = (*) "*" ["wacky"] + // Expression2Op = (*) "*" ["wonky"] + // Expression2Op = (*) "*" [r#"\\w+"#] + // + // ")" -> Shift(S26) + // "*" -> Shift(S10) + // + // Expression2Op -> S25 pub fn __state14< 'input, __TOKENS: Iterator>>, @@ -739,6 +962,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 15 + // Expression1 = Wacky (*) [")"] + // Expression1 = Wacky (*) ["*"] + // + // ")" -> Reduce(Expression1 = Wacky => ActionFn(8);) + // "*" -> Reduce(Expression1 = Wacky => ActionFn(8);) + // pub fn __state15< 'input, __TOKENS: Iterator>>, @@ -773,6 +1003,28 @@ mod __parse__Expression2 { } } + // State 16 + // Expression1 = "&" (*) Maybe Expression1 [")"] + // Expression1 = "&" (*) Maybe Expression1 ["*"] + // Maybe = (*) ["&"] + // Maybe = (*) ["("] + // Maybe = (*) ["wacky"] + // Maybe = (*) ["wonky"] + // Maybe = (*) [r#"\\w+"#] + // Maybe = (*) "[" "]" ["&"] + // Maybe = (*) "[" "]" ["("] + // Maybe = (*) "[" "]" ["wacky"] + // Maybe = (*) "[" "]" ["wonky"] + // Maybe = (*) "[" "]" [r#"\\w+"#] + // + // "&" -> Reduce(Maybe = => ActionFn(31);) + // "(" -> Reduce(Maybe = => ActionFn(31);) + // "[" -> Shift(S12) + // "wacky" -> Reduce(Maybe = => ActionFn(31);) + // "wonky" -> Reduce(Maybe = => ActionFn(31);) + // r#"\\w+"# -> Reduce(Maybe = => ActionFn(31);) + // + // Maybe -> S27 pub fn __state16< 'input, __TOKENS: Iterator>>, @@ -830,6 +1082,35 @@ mod __parse__Expression2 { return Ok(__result); } + // State 17 + // Expression1 = (*) Wacky [")"] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [")"] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [")"] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = "(" (*) Expression2 ")" [")"] + // Expression1 = "(" (*) Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [")"] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [")"] + // Expression1 = (*) r#"\\w+"# ["*"] + // Expression2 = (*) Expression1 [")"] + // Expression2 = (*) Expression1 ["*"] + // Expression2 = (*) Expression2 Expression2Op Expression1 [")"] + // Expression2 = (*) Expression2 Expression2Op Expression1 ["*"] + // Wacky = (*) "wacky" [")"] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S16) + // "(" -> Shift(S17) + // "wacky" -> Shift(S18) + // "wonky" -> Shift(S19) + // r#"\\w+"# -> Shift(S20) + // + // Expression1 -> S13 + // Expression2 -> S28 + // Wacky -> S15 pub fn __state17< 'input, __TOKENS: Iterator>>, @@ -896,6 +1177,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 18 + // Wacky = "wacky" (*) [")"] + // Wacky = "wacky" (*) ["*"] + // + // ")" -> Reduce(Wacky = "wacky" => ActionFn(33);) + // "*" -> Reduce(Wacky = "wacky" => ActionFn(33);) + // pub fn __state18< 'input, __TOKENS: Iterator>>, @@ -934,6 +1222,16 @@ mod __parse__Expression2 { } } + // State 19 + // Expression1 = "wonky" (*) Wonky [")"] + // Expression1 = "wonky" (*) Wonky ["*"] + // Wonky = (*) [")"] + // Wonky = (*) ["*"] + // + // ")" -> Reduce(Wonky = => ActionFn(34);) + // "*" -> Reduce(Wonky = => ActionFn(34);) + // + // Wonky -> S29 pub fn __state19< 'input, __TOKENS: Iterator>>, @@ -984,6 +1282,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 20 + // Expression1 = r#"\\w+"# (*) [")"] + // Expression1 = r#"\\w+"# (*) ["*"] + // + // ")" -> Reduce(Expression1 = r#"\\w+"# => ActionFn(26);) + // "*" -> Reduce(Expression1 = r#"\\w+"# => ActionFn(26);) + // pub fn __state20< 'input, __TOKENS: Iterator>>, @@ -1022,6 +1327,13 @@ mod __parse__Expression2 { } } + // State 21 + // Expression1 = "wonky" Wonky (*) [EOF] + // Expression1 = "wonky" Wonky (*) ["*"] + // + // EOF -> Reduce(Expression1 = "wonky", Wonky => ActionFn(7);) + // "*" -> Reduce(Expression1 = "wonky", Wonky => ActionFn(7);) + // pub fn __state21< 'input, __TOKENS: Iterator>>, @@ -1058,6 +1370,13 @@ mod __parse__Expression2 { } } + // State 22 + // Expression2 = Expression2 Expression2Op Expression1 (*) [EOF] + // Expression2 = Expression2 Expression2Op Expression1 (*) ["*"] + // + // EOF -> Reduce(Expression2 = Expression2, Expression2Op, Expression1 => ActionFn(28);) + // "*" -> Reduce(Expression2 = Expression2, Expression2Op, Expression1 => ActionFn(28);) + // pub fn __state22< 'input, __TOKENS: Iterator>>, @@ -1096,6 +1415,13 @@ mod __parse__Expression2 { } } + // State 23 + // Expression1 = "&" Maybe Expression1 (*) [EOF] + // Expression1 = "&" Maybe Expression1 (*) ["*"] + // + // EOF -> Reduce(Expression1 = "&", Maybe, Expression1 => ActionFn(27);) + // "*" -> Reduce(Expression1 = "&", Maybe, Expression1 => ActionFn(27);) + // pub fn __state23< 'input, __TOKENS: Iterator>>, @@ -1134,6 +1460,19 @@ mod __parse__Expression2 { } } + // State 24 + // Maybe = "[" "]" (*) ["&"] + // Maybe = "[" "]" (*) ["("] + // Maybe = "[" "]" (*) ["wacky"] + // Maybe = "[" "]" (*) ["wonky"] + // Maybe = "[" "]" (*) [r#"\\w+"#] + // + // "&" -> Reduce(Maybe = "[", "]" => ActionFn(32);) + // "(" -> Reduce(Maybe = "[", "]" => ActionFn(32);) + // "wacky" -> Reduce(Maybe = "[", "]" => ActionFn(32);) + // "wonky" -> Reduce(Maybe = "[", "]" => ActionFn(32);) + // r#"\\w+"# -> Reduce(Maybe = "[", "]" => ActionFn(32);) + // pub fn __state24< 'input, __TOKENS: Iterator>>, @@ -1177,6 +1516,30 @@ mod __parse__Expression2 { } } + // State 25 + // Expression1 = (*) Wacky [")"] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [")"] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [")"] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [")"] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [")"] + // Expression1 = (*) r#"\\w+"# ["*"] + // Expression2 = Expression2 Expression2Op (*) Expression1 [")"] + // Expression2 = Expression2 Expression2Op (*) Expression1 ["*"] + // Wacky = (*) "wacky" [")"] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S16) + // "(" -> Shift(S17) + // "wacky" -> Shift(S18) + // "wonky" -> Shift(S19) + // r#"\\w+"# -> Shift(S20) + // + // Expression1 -> S30 + // Wacky -> S15 pub fn __state25< 'input, __TOKENS: Iterator>>, @@ -1236,6 +1599,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 26 + // Expression1 = "(" Expression2 ")" (*) [EOF] + // Expression1 = "(" Expression2 ")" (*) ["*"] + // + // EOF -> Reduce(Expression1 = "(", Expression2, ")" => ActionFn(25);) + // "*" -> Reduce(Expression1 = "(", Expression2, ")" => ActionFn(25);) + // pub fn __state26< 'input, __TOKENS: Iterator>>, @@ -1278,6 +1648,30 @@ mod __parse__Expression2 { } } + // State 27 + // Expression1 = (*) Wacky [")"] + // Expression1 = (*) Wacky ["*"] + // Expression1 = (*) "&" Maybe Expression1 [")"] + // Expression1 = (*) "&" Maybe Expression1 ["*"] + // Expression1 = "&" Maybe (*) Expression1 [")"] + // Expression1 = "&" Maybe (*) Expression1 ["*"] + // Expression1 = (*) "(" Expression2 ")" [")"] + // Expression1 = (*) "(" Expression2 ")" ["*"] + // Expression1 = (*) "wonky" Wonky [")"] + // Expression1 = (*) "wonky" Wonky ["*"] + // Expression1 = (*) r#"\\w+"# [")"] + // Expression1 = (*) r#"\\w+"# ["*"] + // Wacky = (*) "wacky" [")"] + // Wacky = (*) "wacky" ["*"] + // + // "&" -> Shift(S16) + // "(" -> Shift(S17) + // "wacky" -> Shift(S18) + // "wonky" -> Shift(S19) + // r#"\\w+"# -> Shift(S20) + // + // Expression1 -> S31 + // Wacky -> S15 pub fn __state27< 'input, __TOKENS: Iterator>>, @@ -1337,6 +1731,21 @@ mod __parse__Expression2 { return Ok(__result); } + // State 28 + // Expression1 = "(" Expression2 (*) ")" [")"] + // Expression1 = "(" Expression2 (*) ")" ["*"] + // Expression2 = Expression2 (*) Expression2Op Expression1 [")"] + // Expression2 = Expression2 (*) Expression2Op Expression1 ["*"] + // Expression2Op = (*) "*" ["&"] + // Expression2Op = (*) "*" ["("] + // Expression2Op = (*) "*" ["wacky"] + // Expression2Op = (*) "*" ["wonky"] + // Expression2Op = (*) "*" [r#"\\w+"#] + // + // ")" -> Shift(S32) + // "*" -> Shift(S10) + // + // Expression2Op -> S25 pub fn __state28< 'input, __TOKENS: Iterator>>, @@ -1380,6 +1789,13 @@ mod __parse__Expression2 { return Ok(__result); } + // State 29 + // Expression1 = "wonky" Wonky (*) [")"] + // Expression1 = "wonky" Wonky (*) ["*"] + // + // ")" -> Reduce(Expression1 = "wonky", Wonky => ActionFn(7);) + // "*" -> Reduce(Expression1 = "wonky", Wonky => ActionFn(7);) + // pub fn __state29< 'input, __TOKENS: Iterator>>, @@ -1416,6 +1832,13 @@ mod __parse__Expression2 { } } + // State 30 + // Expression2 = Expression2 Expression2Op Expression1 (*) [")"] + // Expression2 = Expression2 Expression2Op Expression1 (*) ["*"] + // + // ")" -> Reduce(Expression2 = Expression2, Expression2Op, Expression1 => ActionFn(28);) + // "*" -> Reduce(Expression2 = Expression2, Expression2Op, Expression1 => ActionFn(28);) + // pub fn __state30< 'input, __TOKENS: Iterator>>, @@ -1454,6 +1877,13 @@ mod __parse__Expression2 { } } + // State 31 + // Expression1 = "&" Maybe Expression1 (*) [")"] + // Expression1 = "&" Maybe Expression1 (*) ["*"] + // + // ")" -> Reduce(Expression1 = "&", Maybe, Expression1 => ActionFn(27);) + // "*" -> Reduce(Expression1 = "&", Maybe, Expression1 => ActionFn(27);) + // pub fn __state31< 'input, __TOKENS: Iterator>>, @@ -1492,6 +1922,13 @@ mod __parse__Expression2 { } } + // State 32 + // Expression1 = "(" Expression2 ")" (*) [")"] + // Expression1 = "(" Expression2 ")" (*) ["*"] + // + // ")" -> Reduce(Expression1 = "(", Expression2, ")" => ActionFn(25);) + // "*" -> Reduce(Expression1 = "(", Expression2, ")" => ActionFn(25);) + // pub fn __state32< 'input, __TOKENS: Iterator>>, diff --git a/lalrpop-test/src/sub.rs b/lalrpop-test/src/sub.rs index 410ce75..9dc6148 100644 --- a/lalrpop-test/src/sub.rs +++ b/lalrpop-test/src/sub.rs @@ -43,6 +43,24 @@ mod __parse__S { ____S(((), i32, ())), } + // State 0 + // E = (*) E "-" T [EOF] + // E = (*) E "-" T ["-"] + // E = (*) T [EOF] + // E = (*) T ["-"] + // S = (*) E [EOF] + // T = (*) "(" E ")" [EOF] + // T = (*) "(" E ")" ["-"] + // T = (*) Num [EOF] + // T = (*) Num ["-"] + // __S = (*) S [EOF] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // E -> S1 + // S -> S2 + // T -> S3 pub fn __state0< __TOKENS: Iterator>, >( @@ -89,6 +107,14 @@ mod __parse__S { } } + // State 1 + // E = E (*) "-" T [EOF] + // E = E (*) "-" T ["-"] + // S = E (*) [EOF] + // + // EOF -> Reduce(S = E => ActionFn(1);) + // "-" -> Shift(S6) + // pub fn __state1< __TOKENS: Iterator>, >( @@ -125,6 +151,11 @@ mod __parse__S { return Ok(__result); } + // State 2 + // __S = S (*) [EOF] + // + // EOF -> Reduce(__S = S => ActionFn(0);) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -156,6 +187,13 @@ mod __parse__S { } } + // State 3 + // E = T (*) [EOF] + // E = T (*) ["-"] + // + // EOF -> Reduce(E = T => ActionFn(3);) + // "-" -> Reduce(E = T => ActionFn(3);) + // pub fn __state3< __TOKENS: Iterator>, >( @@ -188,6 +226,23 @@ mod __parse__S { } } + // State 4 + // E = (*) E "-" T [")"] + // E = (*) E "-" T ["-"] + // E = (*) T [")"] + // E = (*) T ["-"] + // T = (*) "(" E ")" [")"] + // T = (*) "(" E ")" ["-"] + // T = "(" (*) E ")" [EOF] + // T = "(" (*) E ")" ["-"] + // T = (*) Num [")"] + // T = (*) Num ["-"] + // + // "(" -> Shift(S9) + // Num -> Shift(S10) + // + // E -> S7 + // T -> S8 pub fn __state4< __TOKENS: Iterator>, >( @@ -236,6 +291,13 @@ mod __parse__S { return Ok(__result); } + // State 5 + // T = Num (*) [EOF] + // T = Num (*) ["-"] + // + // EOF -> Reduce(T = Num => ActionFn(4);) + // "-" -> Reduce(T = Num => ActionFn(4);) + // pub fn __state5< __TOKENS: Iterator>, >( @@ -272,6 +334,18 @@ mod __parse__S { } } + // State 6 + // E = E "-" (*) T [EOF] + // E = E "-" (*) T ["-"] + // T = (*) "(" E ")" [EOF] + // T = (*) "(" E ")" ["-"] + // T = (*) Num [EOF] + // T = (*) Num ["-"] + // + // "(" -> Shift(S4) + // Num -> Shift(S5) + // + // T -> S11 pub fn __state6< __TOKENS: Iterator>, >( @@ -317,6 +391,15 @@ mod __parse__S { return Ok(__result); } + // State 7 + // E = E (*) "-" T [")"] + // E = E (*) "-" T ["-"] + // T = "(" E (*) ")" [EOF] + // T = "(" E (*) ")" ["-"] + // + // ")" -> Shift(S12) + // "-" -> Shift(S13) + // pub fn __state7< __TOKENS: Iterator>, >( @@ -346,6 +429,13 @@ mod __parse__S { return Ok(__result); } + // State 8 + // E = T (*) [")"] + // E = T (*) ["-"] + // + // ")" -> Reduce(E = T => ActionFn(3);) + // "-" -> Reduce(E = T => ActionFn(3);) + // pub fn __state8< __TOKENS: Iterator>, >( @@ -378,6 +468,23 @@ mod __parse__S { } } + // State 9 + // E = (*) E "-" T [")"] + // E = (*) E "-" T ["-"] + // E = (*) T [")"] + // E = (*) T ["-"] + // T = (*) "(" E ")" [")"] + // T = (*) "(" E ")" ["-"] + // T = "(" (*) E ")" [")"] + // T = "(" (*) E ")" ["-"] + // T = (*) Num [")"] + // T = (*) Num ["-"] + // + // "(" -> Shift(S9) + // Num -> Shift(S10) + // + // E -> S14 + // T -> S8 pub fn __state9< __TOKENS: Iterator>, >( @@ -426,6 +533,13 @@ mod __parse__S { return Ok(__result); } + // State 10 + // T = Num (*) [")"] + // T = Num (*) ["-"] + // + // ")" -> Reduce(T = Num => ActionFn(4);) + // "-" -> Reduce(T = Num => ActionFn(4);) + // pub fn __state10< __TOKENS: Iterator>, >( @@ -462,6 +576,13 @@ mod __parse__S { } } + // State 11 + // E = E "-" T (*) [EOF] + // E = E "-" T (*) ["-"] + // + // EOF -> Reduce(E = E, "-", T => ActionFn(2);) + // "-" -> Reduce(E = E, "-", T => ActionFn(2);) + // pub fn __state11< __TOKENS: Iterator>, >( @@ -498,6 +619,13 @@ mod __parse__S { } } + // State 12 + // T = "(" E ")" (*) [EOF] + // T = "(" E ")" (*) ["-"] + // + // EOF -> Reduce(T = "(", E, ")" => ActionFn(5);) + // "-" -> Reduce(T = "(", E, ")" => ActionFn(5);) + // pub fn __state12< __TOKENS: Iterator>, >( @@ -538,6 +666,18 @@ mod __parse__S { } } + // State 13 + // E = E "-" (*) T [")"] + // E = E "-" (*) T ["-"] + // T = (*) "(" E ")" [")"] + // T = (*) "(" E ")" ["-"] + // T = (*) Num [")"] + // T = (*) Num ["-"] + // + // "(" -> Shift(S9) + // Num -> Shift(S10) + // + // T -> S15 pub fn __state13< __TOKENS: Iterator>, >( @@ -583,6 +723,15 @@ mod __parse__S { return Ok(__result); } + // State 14 + // E = E (*) "-" T [")"] + // E = E (*) "-" T ["-"] + // T = "(" E (*) ")" [")"] + // T = "(" E (*) ")" ["-"] + // + // ")" -> Shift(S16) + // "-" -> Shift(S13) + // pub fn __state14< __TOKENS: Iterator>, >( @@ -612,6 +761,13 @@ mod __parse__S { return Ok(__result); } + // State 15 + // E = E "-" T (*) [")"] + // E = E "-" T (*) ["-"] + // + // ")" -> Reduce(E = E, "-", T => ActionFn(2);) + // "-" -> Reduce(E = E, "-", T => ActionFn(2);) + // pub fn __state15< __TOKENS: Iterator>, >( @@ -648,6 +804,13 @@ mod __parse__S { } } + // State 16 + // T = "(" E ")" (*) [")"] + // T = "(" E ")" (*) ["-"] + // + // ")" -> Reduce(T = "(", E, ")" => ActionFn(5);) + // "-" -> Reduce(T = "(", E, ")" => ActionFn(5);) + // pub fn __state16< __TOKENS: Iterator>, >( diff --git a/lalrpop-test/src/use_super.rs b/lalrpop-test/src/use_super.rs index b82c462..1b4e73e 100644 --- a/lalrpop-test/src/use_super.rs +++ b/lalrpop-test/src/use_super.rs @@ -41,6 +41,13 @@ mod __parse__S { ____S(((), i32, ())), } + // State 0 + // S = (*) "(" ")" [EOF] + // __S = (*) S [EOF] + // + // "(" -> Shift(S2) + // + // S -> S1 pub fn __state0< __TOKENS: Iterator>, >( @@ -75,6 +82,11 @@ mod __parse__S { } } + // State 1 + // __S = S (*) [EOF] + // + // EOF -> Reduce(__S = S => ActionFn(0);) + // pub fn __state1< __TOKENS: Iterator>, >( @@ -106,6 +118,11 @@ mod __parse__S { } } + // State 2 + // S = "(" (*) ")" [EOF] + // + // ")" -> Shift(S3) + // pub fn __state2< __TOKENS: Iterator>, >( @@ -134,6 +151,11 @@ mod __parse__S { return Ok(__result); } + // State 3 + // S = "(" ")" (*) [EOF] + // + // EOF -> Reduce(S = "(", ")" => ActionFn(1);) + // pub fn __state3< __TOKENS: Iterator>, >(