Skip to main content

An Early-Algorithm Context-free grammar Parser

Project description

buildstatus

SPARK

SPARK stands for Scanning, Parsing, and Rewriting Kit. It uses Jay Early’s algorithm for LR parsing and comes with some generic Abstract Syntax Tree routines. There is also a prototype scanner which does its job by combining Python regular expressions.

The original version of this was written by John Aycock and was described in his 1988 paper: “Compiling Little Languages in Python” at the 7th International Python Conference.

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 example; Package uncompyle6 uses this and contains a much larger example.

See Also

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page