https://github.com/defnull/modg
Fork of the modgrammar package by Alex Stewart
https://github.com/defnull/modg
Last synced: over 1 year ago
JSON representation
Fork of the modgrammar package by Alex Stewart
- Host: GitHub
- URL: https://github.com/defnull/modg
- Owner: defnull
- Created: 2015-11-18T19:28:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T19:28:56.000Z (over 10 years ago)
- Last Synced: 2025-01-26T03:45:06.484Z (over 1 year ago)
- Language: Python
- Size: 1.43 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: CHANGELOG
Awesome Lists containing this project
README
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.