Crate rusty_parser

source ·

Macros§

  • Or combinator of parsers Example: or!( parser_a, or_b, or_c )
  • Sequence of parsers Example: seq!( parser_a, and_then_b, and_then_c )

Structs§

  • Dictionary using trie implementation uses BTreeMap; O(log(N)) search
  • Dictionary using trie implementation uses HashMap; O(1) search
  • a Box<dyn Parser> wrapper for iterators of std::str::Chars This can take any parser with Output of Output
  • a Box<dyn Parser> wrapper for iterators of std::slice::Iter This can take any parser with Output of Output
  • struct that holds the result of parsing output: parsed data it: iterator after parsing Result of parsing
  • Rc<Parser> wrapper;
  • RefCell<Parser> wrapper;

Traits§

  • a trait alias that Input Iterator must hold
  • Trait for converting possible types to Parser
  • Parser trait all parsers must implement this trait

Functions§

  • create a Box<dyn Parser> wrapper for iterators of std::str::Chars This can take any parser with Output of Output
  • create a Box<dyn Parser> wrapper for iterators of std::slice::Iter This can take any parser with Output of Output
  • This Parser will compare the input string starts with the given string.
  • This Parser will always success and return the clone of given output.
  • parser that success if reached end of input
  • This Parser will always fail.
  • convert the given type to Parser ( if it impl IntoParser )
  • Map parser’s Output to new value
  • match the input with the given parser This does not construct the output, just check the input is matched or not.
  • match for parser1 parser2, parser1 must success and parser2 must fail
  • Parser will not consume the input iterator It still match and return the output
  • Check one character is equal to the given character.
  • this parser always success whether the input is matched or not
  • this parser always success whether the input is matched or not if failed, return the given value in parameter
  • Or combinator of parsers
  • change Parser’s Output to output
  • parse the input with the given parser
  • This Parser will use the closure to parse the input.
  • Check one character is in the given range.
  • create Rc<Parser> wrapper
  • parser reference wrapper
  • create RefCell<Parser> wrapper
  • repeat parser for given range ( this matches as long as possible )
  • concatenate two parser
  • This Parser will compare the input string starts with the given slice
  • returns String of parsed input only works for parsing with std::str::Chars
  • returns Vec of parsed input only works for parsing with std::slice::Iter
  • change Parser’s Output to (). This internally call match_pattern() instead of parse()