Git Product home page Git Product logo

peggy's Introduction

Tests npm version License

Peggy

Peggy is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

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:

  1. Uninstall pegjs (and @types/pegjs if you're using the DefinitelyTyped type definitions - we now include type definitions as part of peggy itself).
  2. Replace all require("pegjs") or import ... from "pegjs" with require("peggy") or import ... from "peggy" as appropriate.
  3. Any scripts that use the pegjs cli should now use peggy instead.
  4. That's it!

Features

  • 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
  • Usable from your browser, from the command line, or via JavaScript API
  • Source map support

Getting Started

Online version is the easiest way to generate a parser. Just enter your grammar, try parsing few inputs, and download generated parser code.

Documentation

Full documentation is available at peggyjs.org.

Development

To get started, check out peggy, install the dependencies, and run build:

git clone https://github.com/peggyjs/peggy.git
cd peggy
npm install
(cd docs && npm install)
(cd web-test && npm install)
npm run build
npm run test:web

Please see the Contribution Guidelines for details on how to contribute code.

Links

Peggy was originally developed by David Majda (@dmajda). It is currently maintained by Joe Hildebrand (@hildjj).

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.

peggy's People

Contributors

dmajda avatar hildjj avatar mingun avatar camchenry avatar phpnode avatar arlolra avatar jaubourg avatar nene avatar fatfisz avatar andrewraycode avatar joseph-onsip avatar kristiandupont avatar sampsyo avatar atavakoli avatar cmfcmf avatar vrana avatar hyperpape avatar marcelbolten avatar felix9 avatar fpirsch avatar almad avatar andreineculau avatar bkutil avatar chearon avatar dselman avatar darlanalves avatar jasondavies avatar stonecypher avatar frostburn avatar mbaumgartl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.