Peggy is the successor of PEG.js.
Migrating from PEG.js
Peggy version 1.x.x is API compatible with the most recent PEG.js release. Follow these steps to upgrade:
@types/pegjsif you're using the DefinitelyTyped type definitions - we now include type definitions as part of peggy itself).
- Replace all
import ... from "pegjs"with
import ... from "peggy"as appropriate.
- Any scripts that use the
pegjscli should now use
- That's it!
- Simple and expressive grammar syntax
- Integrates both lexical and syntactical analysis
- Parsers have excellent error reporting out of the box
- Based on parsing expression grammar formalism — more powerful than traditional LL(k) and LR(k) parsers
- Source map support
Online version is the easiest way to generate a parser. Just enter your grammar, try parsing few inputs, and download generated parser code.
Full documentation is available at peggyjs.org.
- Project website
- Source code
- Issue tracker
- Browser Benchmark Suite
- Browser Test Suite
- Discord Server
You are welcome to contribute code. Unless your contribution is really trivial you should get in touch with us first — this can prevent wasted effort on both sides.