Skip to main content

Modular grammar-parsing engine (Python 2.6+ / Python 3.x)

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.

Documentation: http://rembish.github.com/modgrammar-py2 Parent Project: http://code.google.com/p/modgrammar

Some features include:

  • Pure-Python cross-platform design.
  • Grammar definitions are created 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 be given custom methods and behaviors as part of the grammar definition, 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.
  • Python 2.6+, 3.x support

Download files

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

Files for modgrammar-py2, version 0.9.2
Filename, size File type Python version Upload date Hashes
Filename, size modgrammar_py2-0.9.2-py2.7.egg (62.0 kB) File type Egg Python version 2.7 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