pyg will be a PEG parser library formed as an internal Python DSL. it will be used in cramex, a copycat of cram with expect support.
The surface is heading to resemble Boost.Spirit: grammars are composed using a vaguely (xBNF/PEG)-like syntax enabled through operator overloading.
>>> from pyg import Rule, chr, int
>>> n = Rule('number') >>> o = Rule('operator') >>> e = Rule('expression')
>>> e %= n >> o >> n >>> o %= chr('+-') >>> n %= int
>>> e.matches('42 + 69') True, None >>> e.matches('69') True, None >>> e.matches('42 69') False, "Failed on line 1 column 3:\n42 69\n ^\n"
This project is part of:
Hack Week 10
Activity
Comments
-
over 9 years ago by rneuhauser | Reply
https://github.com/roman-neuhauser/py-impala - Import packages and modules from arbitrary directories and files
Similar Projects
OSSelot collaboration on legal reviews of community packages by lkocman
[comment]: # (Please use the project descriptio...
One of couple of Python projects (update M2Crypto) by mcepl
There are couple of projects I work on, which n...
Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil
Join the Gitter channel! [https://gitter.im/uy...
Give some love to spec-cleaner by kstreitova
Project Description
spec-cleaner is an open...
Linux Immersive Learning System (LILS) by dgarcia
[comment]: # (Please use the project descriptio...