Skip to main content

Modular grammar-parsing engine

Project description

Modgrammar is a general-purpose library for building language parsers and interpreters using context-free grammar definitions in Python. Language parsing rules (grammars) are defined as standard Python classes, which can then be 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.

  • Full Unicode support

  • Grammars are defined using standard Python syntax.

  • Supports arbitrarily complex grammars, including recursion.

  • Defining a grammar automatically creates a working parser in the process (no compilation steps or lengthy startup times).

  • Parse results contain full parse-tree information, including heirarchical tokenization of the input.

  • Parse result objects can have custom methods, producing rich data objects.

  • 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

modgrammar-0.10.tar.gz (86.4 kB view details)

Uploaded Source

File details

Details for the file modgrammar-0.10.tar.gz.

File metadata

  • Download URL: modgrammar-0.10.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for modgrammar-0.10.tar.gz
Algorithm Hash digest
SHA256 b957cc9cc5bcc4da3b0795d63d33d421cf28db186acab74f83847de8311fa09a
MD5 8d4b335a40fd88eef58dce32bb61e2f4
BLAKE2b-256 6f24f9f2756af2de13ebb3565f03720fd7baee7cbc385320da0243db8823a8c4

See more details on using hashes here.

Supported by

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