An Earley-Algorithm Context-free grammar Parser Toolkit
Project description
SPARK
SPARK stands for Scanning, Parsing, and Rewriting Kit. It 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.
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.
See Also
http://pages.cpsc.ucalgary.ca/~aycock/spark/ (Old and not very well maintained)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for spark_parser-1.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0d20889bf424b4ec921c28a5c6d30618e16a3d62b522364f8b1ffa9b8cb119 |
|
MD5 | 40423d45a9a0a8bf839e7833bd96f158 |
|
BLAKE2b-256 | 2b73d4a3ac394fb1fd94937528e4f3f35a11e7c82483315ec2d980a2978452a2 |
Hashes for spark_parser-1.5.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c76aba2f8c733c9314cd106f21cbd4f70a4bd44f661e6dc2f29bb9482e0195e4 |
|
MD5 | 7c546b3f91df5f7df565dd8c8407c57d |
|
BLAKE2b-256 | 36f1cb64ebe49ea87f714c4223d5a66df5151653b826b02a677519a0562edbb2 |