Modular grammar-parsing engine
Project description
Modgrammar is a general-purpose library for constructing language parsers and interpreters using context-free grammar definitions in Python. Language parsing rules (grammars) can be defined using standard Python syntax, and then used to parse and validate input strings or files into meaningful data structures. Possible applications range from simple input validation, to complex expression evaluation, to full-fledged programming language parsing for compilers or interpreters.
Some features include:
Pure-Python cross-platform design.
Grammar definitions are done using standard Python syntax.
Supports arbitrarily complex grammars, including recursion.
Defining a grammar automatically creates a working parser for that grammar in the process.
Parse results contain full parse-tree information, including heirarchical tokenization of the input.
Parse result objects can be given custom methods and behaviors as part of the grammar definition.
Modular grammar design supports distributing grammars as python library modules, combining grammars from multiple sources into larger grammars, and even parameterized grammar definitions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file modgrammar-0.6.tar.gz
.
File metadata
- Download URL: modgrammar-0.6.tar.gz
- Upload date:
- Size: 54.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef95c44b3289f536affa4828664f2f6f089cfda34a43da35ab68b423aff88a4c |
|
MD5 | 6a78caafb15edd2879b5a66bf4202eab |
|
BLAKE2b-256 | a9ed408744b12e52ed8e1499f1ad88bb91a57cb751e5b30a5496d6359990d500 |