Skip to content
An Earley-Algorithm Context-free grammar Parser Toolkit
Python PowerShell Shell Batchfile Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
admin-tools
appveyor
bin
example
spark_parser
test
.gitignore
.travis.yml
LICENSE
MANIFEST.in
Makefile
NEW-FEATURES.rst
NEWS
NEWS.md
README.rst
README2.rst
TODO.rst
appveyor.yml
requirements-dev.txt
requirements.txt
setup.py
tox.ini

README.rst

buildstatus Pypi Installs Latest Version Supported Python Versions

packagestatus

An Earley Algorithm Parser toolkit.

This package uses Jay Earley's algorithm for parsing context free grammars, and comes with some generic Abstract Syntax Tree routines. There is also a prototype scanner which does its job by combining Python regular expressions.

(SPARK stands for Scanning, Parsing, and Rewriting Kit. It is a poor name since it conflicts with a more popular package of the same name. In the future we will rename this.)

The original version of this was written by John Aycock for his Ph.d thesis and was described in his 1998 paper: "Compiling Little Languages in Python" at the 7th International Python Conference. The current incarnation of this code is maintained (or not) by Rocky Bernstein.

Note: Earley algorithm parsers are almost linear when given an LR grammar. These are grammars which are left-recursive.

Installation

This uses setup.py, so it follows the standard Python routine:

$ pip install -e .  # set up to run from source tree
                    # Or if you want to install instead
$ python setup.py develop

Example

The github example directory has a worked-out examples; Package uncompyle6 uses this and contains a much larger example.

See Also

You can’t perform that action at this time.