nearley.js
Parsers turn strings of characters into meaningful data structures (like a JSON object!). nearley is a fast, robust, and modern parser generator for JavaScript. You'll love it because:
- nearley is the first JS parser to use the Earley algorithm (insert your own ‘early bird’ pun here). It lives happily in node, but doesn't mind the browser.
- nearley outputs small files, proportional to the size of the grammar. And it comes with plenty of syntactic sugar to keep your source files short. And sweet.
- nearley is built on an idiomatic streaming API. You even have access to partial parses as you feed it data.
- nearley processes left recursion without
choking. In fact, nearley will parse anything you throw at it
without complaining or going into a
sulkinfinite loop.

Never again. <3
- nearley handles ambiguous grammars gracefully. Ambiguous grammars can be parsed in multiple ways: instead of getting confused, nearley gives you all the parsings (in a deterministic order!).
- nearley allows for debugging with generous error detection. When it catches a parse-time error, nearley tells you what went wrong and where.
- nearley is powerful enough to be bootstrapped. That means nearley uses nearley to compile parts of nearley. nearleyception!
Excited? Get started on Github, visit us on npm, or play with the calculator demo for more action.