mpg

Crates.iompg
lib.rsmpg
version0.0.0
sourcesrc
created_at2022-07-04 01:32:21.629964
updated_at2022-07-04 01:32:21.629964
descriptionSquatted crate for a Modern Parser Generator
homepage
repository
max_upload_size
id618650
size2,299
Christopher Durham (CAD97)

documentation

README

Squatted crate for a Modern Parser Generator.

Contact @CAD97 if you want to collaborate on development of this tool. Solo development will happen when they find time and motivation concurrently.

Until then, check out tree-sitter.

Namely, inspired by matklad's post, mpg will provide

UX

Tooling designed IDE-first.

  • Interactive development. Provide example inputs while editing the grammar and immediately see the resulting syntax trees.
  • Inline snapshot tests. Example productions listed next to the defining rules are automatically tested with the resulting syntax trees tracked in version control.
  • Full LSP support.

API

  • Designed to be used on top of a separate lexer.
  • Supports pull-lexing with principled lexical feedback.
  • Prefers pre-lexing with replayable incremental reparsing.
  • Produces a homogeneous literal syntax tree.
  • Provides an optional typed view of the literal syntax tree.
  • Embeddable anywhere via a C API.

Parsing Techniques

  • Specify operator precedence and associativity directly.
  • Strong error tolerance/recovery via follow sets and explicit recovery points.
  • Choose your tradeoffs:
    • Guaranteed determinism at a cost of generality.
    • Full generality at the cost of ambiguity.

Quality of incorrect syntax error messages is a non-priority left to the user.

Commit count: 0

cargo fmt