Skip to main content

An Earley-Algorithm Context-free grammar Parser Toolkit

Project description

buildstatus Supported Python Versions

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:

python setup.py install # may need sudo
# or if you have pyenv:
python setup.py develop

Example

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for spark-parser, version 1.8.9
Filename, size File type Python version Upload date Hashes
Filename, size spark_parser-1.8.9-py2.4.egg (36.1 kB) File type Egg Python version 2.4 Upload date Hashes View
Filename, size spark_parser-1.8.9-py2.6.egg (35.6 kB) File type Egg Python version 2.6 Upload date Hashes View
Filename, size spark_parser-1.8.9-py26-none-any.whl (19.1 kB) File type Wheel Python version py26 Upload date Hashes View
Filename, size spark_parser-1.8.9-py2-none-any.whl (18.0 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size spark_parser-1.8.9-py38-none-any.whl (18.0 kB) File type Wheel Python version py38 Upload date Hashes View
Filename, size spark_parser-1.8.9-py3-none-any.whl (18.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size spark_parser-1.8.9.tar.gz (118.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page