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