grammar-to-marser

Pest → Marser Rust converter

Loading…
Empty = last rule
Grammar input
Generated parser
Errors
Grammar reference

Supported

  • Grouping, sequences, and choice: (...), ~, |
  • Predicates and repetition: &, !, ?, *, +, {n}, {n,}, {,n}, {n,m}
  • Rule modifiers: silent _, atomic @, compound atomic $, non-atomic !
  • Strings, case-insensitive strings, ranges, and node tags: "...", ^"...", 'a'..'z', #name = expr
  • Implicit trivia via WHITESPACE and COMMENT rules
  • Builtins: SOI, EOI, ANY, NEWLINE, ASCII_DIGIT, ASCII_NONZERO_DIGIT, ASCII_BIN_DIGIT, ASCII_OCT_DIGIT, ASCII_HEX_DIGIT, ASCII_ALPHA_LOWER, ASCII_ALPHA_UPPER, ASCII_ALPHA, ASCII_ALPHANUMERIC
  • Right and mutual recursion, up to 12 rules per recursive group

Not yet supported

  • Stack constructs: PUSH, PUSH_LITERAL, POP, POP_ALL, DROP, PEEK, PEEK_ALL
  • Left recursion
  • Recursive groups larger than 12 rules
  • Pest-style Pair trees, spans, or .memoized()

Some unsupported constructs are still parsed so the editor can point at them precisely, but conversion fails with an explicit error. Generated output returns a typed Parsed<'src> enum with one variant per rule; tagged binds become named fields and leaf rules store their matched slice as value.