Earley Parser Documentation

Get started now

To import this code via a CDN or npm, check out the API Reference Page.

Background

The Earley Parsing algorithm can parse strings according to any context-free grammar. This module lets the user define tokens and grammar rules, then pass strings in to be tokenized and parsed, or just pass in pre-tokenized arrays to be parsed.

Parse trees are returned as nested JavaScript arrays, but the user can also provide callbacks that construct other kinds of hierarchical structures (or do computation) instead of building parse trees.

More Information

The following additional information is available in this documentation.

  • Source Code - see the source and/or import it into your own project
  • API Reference - how to use the various functions and objects provided

More documentation may be added here in the future. For now you can view this repository github.