Merge pull request #102 from nikomatsakis/configuration

Introduce a `Configuration` builder for advanced usage
This commit is contained in:
Niko Matsakis 2016-03-07 09:25:48 -05:00
commit bb5c741658
21 changed files with 5231 additions and 93 deletions

View File

@ -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();
}

View File

@ -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<Item=Result<(usize, Tok, usize),char>>,
>(
@ -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<Item=Result<(usize, Tok, usize),char>>,
>(
@ -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<Item=Result<(usize, Tok, usize),char>>,
>(
@ -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<Item=Result<(usize, Tok, usize),char>>,
>(

View File

@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(

File diff suppressed because it is too large Load Diff

View File

@ -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,

View File

@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,

View File

@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(

View File

@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -79,6 +89,11 @@ mod __parse__E {
}
}
// State 1
// __E = E (*) [EOF]
//
// EOF -> Reduce(__E = E => ActionFn(0);)
//
pub fn __state1<
'input,
__TOKENS: Iterator<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -195,6 +226,11 @@ mod __parse__E {
}
}
// State 4
// E = "&" E (*) [EOF]
//
// EOF -> Reduce(E = "&", E => ActionFn(7);)
//
pub fn __state4<
'input,
__TOKENS: Iterator<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,

View File

@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,

View File

@ -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<Item=Result<((), LtTok<'input>, ()),()>>,
@ -94,6 +108,11 @@ mod __parse__Expr {
}
}
// State 1
// __Expr = Expr (*) [EOF]
//
// EOF -> Reduce(__Expr = Expr => ActionFn(0);)
//
pub fn __state1<
'input,
__TOKENS: Iterator<Item=Result<((), LtTok<'input>, ()),()>>,
@ -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<Item=Result<((), LtTok<'input>, ()),()>>,
@ -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<Item=Result<((), LtTok<'input>, ()),()>>,
@ -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<Item=Result<((), LtTok<'input>, ()),()>>,

View File

@ -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<Item=Result<(usize, Tok, usize),()>>,
>(
@ -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<Item=Result<(usize, Tok, usize),()>>,
>(
@ -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<Item=Result<(usize, Tok, usize),()>>,
>(
@ -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<Item=Result<(usize, Tok, usize),()>>,
>(
@ -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<Item=Result<(usize, Tok, usize),()>>,
>(

View File

@ -46,6 +46,34 @@ mod __parse__Expression2 {
____Expression2((usize, Box<Expr<'input>>, 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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,
@ -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<Item=Result<(usize, (usize, &'input str), usize),__ParseError<usize,(usize, &'input str),()>>>,

View File

@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -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<Item=Result<((), Tok, ()),()>>,
>(

View File

@ -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<Item=Result<((), Tok, ()),()>>,
>(
@ -75,6 +82,11 @@ mod __parse__S {
}
}
// State 1
// __S = S (*) [EOF]
//
// EOF -> Reduce(__S = S => ActionFn(0);)
//
pub fn __state1<
__TOKENS: Iterator<Item=Result<((), Tok, ()),()>>,
>(
@ -106,6 +118,11 @@ mod __parse__S {
}
}
// State 2
// S = "(" (*) ")" [EOF]
//
// ")" -> Shift(S3)
//
pub fn __state2<
__TOKENS: Iterator<Item=Result<((), Tok, ()),()>>,
>(
@ -134,6 +151,11 @@ mod __parse__S {
return Ok(__result);
}
// State 3
// S = "(" ")" (*) [EOF]
//
// EOF -> Reduce(S = "(", ")" => ActionFn(1);)
//
pub fn __state3<
__TOKENS: Iterator<Item=Result<((), Tok, ()),()>>,
>(

121
lalrpop/src/api/mod.rs Normal file
View File

@ -0,0 +1,121 @@
use build;
use log::Level;
use session::{ColorConfig, Session};
use std::default::Default;
use std::env::current_dir;
use std::error::Error;
use std::path::Path;
use std::rc::Rc;
/// Configure various aspects of how LALRPOP works.
/// Intended for use within a `build.rs` script.
/// To get the default configuration, use `Configuration::new`.
#[derive(Clone, Default)]
pub struct Configuration {
session: Session
}
impl Configuration {
/// Creates the default configuration; equivalent to `Configuration::default`.
pub fn new() -> Configuration {
Configuration::default()
}
/// Always use ANSI colors in output, even if output does not appear to be a TTY.
pub fn always_use_colors(&mut self) -> &mut Configuration {
self.session.color_config = ColorConfig::Yes;
self
}
/// Never use ANSI colors in output, even if output appears to be a TTY.
pub fn never_use_colors(&mut self) -> &mut Configuration {
self.session.color_config = ColorConfig::No;
self
}
/// Use ANSI colors in output if output appears to be a TTY, but
/// not otherwise. This is the default.
pub fn use_colors_if_tty(&mut self) -> &mut Configuration {
self.session.color_config = ColorConfig::IfTty;
self
}
/// If true, always convert `.lalrpop` files into `.rs` files, even if the
/// `.rs` file is newer. Default is false.
pub fn force_build(&mut self, val: bool) -> &mut Configuration {
self.session.force_build = val;
self
}
/// If true, emit comments into the generated code. This makes the
/// generated code significantly larger. Default is false.
pub fn emit_comments(&mut self, val: bool) -> &mut Configuration {
self.session.emit_comments = val;
self
}
/// Minimal logs: only for errors that halt progress.
pub fn log_quiet(&mut self) -> &mut Configuration {
self.session.log.set_level(Level::Taciturn);
self
}
/// Informative logs: give some high-level indications of
/// progress (default).
pub fn log_info(&mut self) -> &mut Configuration {
self.session.log.set_level(Level::Informative);
self
}
/// Verbose logs: more than info, but still not overwhelming.
pub fn log_verbose(&mut self) -> &mut Configuration {
self.session.log.set_level(Level::Verbose);
self
}
/// Debug logs: better redirect this to a file. Intended for
/// debugging LALRPOP itself.
pub fn log_debug(&mut self) -> &mut Configuration {
self.session.log.set_level(Level::Debug);
self
}
/// Process all files in the current directory, which -- unless you
/// have changed it -- is typically the root of the crate being compiled.
pub fn process_current_dir(&self) -> Result<(), Box<Error>> {
self.process_dir(try!(current_dir()))
}
/// Process all `.lalrpop` files in `path`.
pub fn process_dir<P:AsRef<Path>>(&self, path: P) -> Result<(), Box<Error>> {
let session = Rc::new(self.session.clone());
try!(build::process_dir(session, path));
Ok(())
}
/// Process the given `.lalrpop` file.
pub fn process_file<P:AsRef<Path>>(&self, path: P) -> Result<(), Box<Error>> {
let session = Rc::new(self.session.clone());
try!(build::process_file(session, path));
Ok(())
}
}
/// Process all files in the current directory, which -- unless you
/// have changed it -- is typically the root of the crate being compiled.
///
/// Equivalent to `Configuration::new().process_current_dir()`.
pub fn process_root() -> Result<(), Box<Error>> {
Configuration::new().process_current_dir()
}
/// Deprecated in favor of `Configuration`. Try:
///
/// ```rust
/// Configuration::new().force_build(true).process_current_dir()
/// ```
///
/// instead.
pub fn process_root_unconditionally() -> Result<(), Box<Error>> {
Configuration::new().force_build(true).process_current_dir()
}

View File

@ -17,7 +17,6 @@ use term;
use tls::Tls;
use tok;
use std::env::current_dir;
use std::fs;
use std::io::{self, Write};
use std::path::{Path, PathBuf};
@ -29,33 +28,18 @@ mod fake_term;
use self::fake_term::FakeTerminal;
pub fn process_root() -> io::Result<()> {
let session = Session::new();
process_dir(&session, try!(current_dir()))
}
pub fn process_root_unconditionally() -> io::Result<()> {
let mut session = Session::new();
session.set_force_build();
process_dir(&session, try!(current_dir()))
}
fn process_dir<P:AsRef<Path>>(session: &Session, root_dir: P) -> io::Result<()> {
pub fn process_dir<P:AsRef<Path>>(session: Rc<Session>, root_dir: P) -> io::Result<()> {
let lalrpop_files = try!(lalrpop_files(root_dir));
for lalrpop_file in lalrpop_files {
try!(process_file(session, lalrpop_file));
try!(process_file(session.clone(), lalrpop_file));
}
Ok(())
}
pub fn process_file<P:AsRef<Path>>(session: &Session, lalrpop_file: P) -> io::Result<()> {
// Promote the session to an Rc so that we can stick it in TLS. I
// don't want this to be part of LALRPOP's "official" interface
// yet so don't take an `Rc<Session>` as an argument.
let session = Rc::new(session.clone());
pub fn process_file<P:AsRef<Path>>(session: Rc<Session>, lalrpop_file: P) -> io::Result<()> {
let lalrpop_file: &Path = lalrpop_file.as_ref();
let rs_file = lalrpop_file.with_extension("rs");
if session.force_build() || try!(needs_rebuild(&lalrpop_file, &rs_file)) {
if session.force_build || try!(needs_rebuild(&lalrpop_file, &rs_file)) {
log!(session, Informative, "processing file `{}`", lalrpop_file.to_string_lossy());
try!(make_read_only(&rs_file, false));
try!(remove_old_file(&rs_file));
@ -263,7 +247,7 @@ fn report_content(content: &Content) -> term::Result<()> {
// FIXME -- can we query the size of the terminal somehow?
let canvas = content.emit_to_canvas(80);
let try_colors = match Tls::session().color_config() {
let try_colors = match Tls::session().color_config {
ColorConfig::Yes => true,
ColorConfig::No => false,
ColorConfig::IfTty => atty::is(),

View File

@ -70,12 +70,6 @@ fn add_range(range: Test,
let mid_range = Test { start: mid_min, end: mid_max };
let max_range = Test { start: mid_max, end: max_max };
println!("range={:?}", range);
println!("overlapping_range={:?}", overlapping_range);
println!("low_range={:?}", low_range);
println!("mid_range={:?}", mid_range);
println!("max_range={:?}", max_range);
assert!(low_range.is_disjoint(mid_range));
assert!(low_range.is_disjoint(max_range));
assert!(mid_range.is_disjoint(max_range));

View File

@ -31,6 +31,7 @@ mod rust;
#[macro_use]
mod log;
mod api;
mod ascii_canvas;
mod build;
mod collections;
@ -51,10 +52,7 @@ mod util;
#[cfg(test)] mod generate;
#[cfg(test)] mod test_util;
pub use build::process_root;
pub use build::process_root_unconditionally;
pub use build::process_file;
pub use log::Level;
pub use log::Log;
pub use session::ColorConfig;
pub use session::Session;
pub use api::Configuration;
pub use api::process_root;
pub use api::process_root_unconditionally;

View File

@ -247,7 +247,7 @@ impl<'ascent,'grammar,W:Write> RecursiveAscent<'ascent,'grammar,W> {
};
// Leave a comment explaining what this state is.
if Tls::session().emit_comments() {
if Tls::session().emit_comments {
rust!(self.out, "// State {}", this_index.0);
for item in this_state.items.vec.iter() {
rust!(self.out, "// {:?}", item);

View File

@ -3,7 +3,7 @@ extern crate lalrpop;
extern crate rustc_serialize;
use docopt::Docopt;
use lalrpop::{process_file, Level, ColorConfig, Session};
use lalrpop::Configuration;
use std::env;
use std::io::{self, Write};
use std::process;
@ -20,39 +20,34 @@ fn main1() -> io::Result<()> {
.and_then(|d| d.argv(env::args()).decode())
.unwrap_or_else(|e| e.exit());
let mut session = Session::new();
let mut config = Configuration::new();
match args.flag_level.unwrap_or(LevelFlag::Info) {
LevelFlag::Quiet => session.set_log_level(Level::Taciturn),
LevelFlag::Info => session.set_log_level(Level::Informative),
LevelFlag::Verbose => session.set_log_level(Level::Verbose),
LevelFlag::Debug => session.set_log_level(Level::Debug),
}
LevelFlag::Quiet => config.log_quiet(),
LevelFlag::Info => config.log_info(),
LevelFlag::Verbose => config.log_verbose(),
LevelFlag::Debug => config.log_debug(),
};
if args.flag_force {
session.set_force_build();
}
if args.flag_help {
try!(writeln!(stderr, "{}", USAGE));
process::exit(1);
config.force_build(true);
}
if args.flag_color {
session.set_color_config(ColorConfig::Yes);
config.always_use_colors();
}
if args.flag_comments {
session.set_emit_comments();
config.emit_comments(true);
}
if args.arg_inputs.len() == 0 {
try!(writeln!(stderr, "Error: no input files specified! Try -h for help."));
try!(writeln!(stderr, "Error: no input files specified! Try --help for help."));
process::exit(1);
}
for arg in args.arg_inputs {
match process_file(&session, &arg) {
match config.process_file(&arg) {
Ok(()) => { }
Err(err) => {
try!(writeln!(stderr, "Error encountered processing `{}`: {}",
@ -66,10 +61,13 @@ fn main1() -> io::Result<()> {
}
const USAGE: &'static str = "
Usage: lalrpop [options] <inputs>...
Usage: lalrpop [options] inputs...
lalrpop --help
Convert each of the given inputs (which should be a `.lalrpop` file)
into a `.rs` file, just as a `build.rs` script using LALRPOP would do.
Options:
-h, --help Show this message.
-l, --level LEVEL Set the debug level. (Default: info)
Valid values: quiet, info, verbose, debug.
-f, --force Force execution, even if the .lalrpop file is older than the .rs file.
@ -82,7 +80,6 @@ struct Args {
arg_inputs: Vec<String>,
flag_level: Option<LevelFlag>,
flag_force: bool,
flag_help: bool,
flag_color: bool,
flag_comments: bool,
}

View File

@ -1,7 +1,14 @@
//! Internal configuration and session-specific settings. This is similar
//! to `configuration::Configuration`, but it is not exported outside the
//! crate. Note that all fields are public and so forth for convenience.
use std::default::Default;
use style::{self, Style};
use log::{Log, Level};
// These two, ubiquitous types are defined here so that their fields can be private
// across crate, but visible within the crate:
#[derive(Copy, Clone)]
pub enum ColorConfig {
/// Use ANSI colors.
@ -20,20 +27,20 @@ pub enum ColorConfig {
/// expected to use it.
#[derive(Clone)]
pub struct Session {
log: Log,
pub log: Log,
force_build: bool,
pub force_build: bool,
/// Emit comments in generated code explaining the states and so
/// forth.
emit_comments: bool,
pub emit_comments: bool,
color_config: ColorConfig,
pub color_config: ColorConfig,
/// Stop after you find `max_errors` errors. If this value is 0,
/// report *all* errors. Note that we MAY always report more than
/// this value if we so choose.
max_errors: usize,
pub max_errors: usize,
// Styles to use when formatting error reports
@ -102,44 +109,12 @@ impl Session {
}
}
pub fn color_config(&self) -> ColorConfig {
self.color_config
}
pub fn set_color_config(&mut self, config: ColorConfig) {
self.color_config = config;
}
pub fn set_force_build(&mut self) {
self.force_build = true;
}
pub fn set_emit_comments(&mut self) {
self.emit_comments = true;
}
pub fn set_max_errors(&mut self, errors: usize) {
self.max_errors = errors;
}
pub fn set_log_level(&mut self, level: Level) {
self.log.set_level(level);
}
/// Indicates whether we should stop after `actual_errors` number
/// of errors have been reported.
pub fn stop_after(&self, actual_errors: usize) -> bool {
self.max_errors != 0 && actual_errors >= self.max_errors
}
pub fn force_build(&self) -> bool {
self.force_build
}
pub fn emit_comments(&self) -> bool {
self.emit_comments
}
pub fn log<M>(&self, level: Level, message: M)
where M: FnOnce() -> String
{