Python version of SimplePEG
Project description
Python version of SimplePEG
--------
To use, simply do::
>>> from simplepeg import SPEG
>>> parser = SPEG()
>>> parser.parse_grammar('GRAMMAR test b -> "a";')
>>> ast = parser.parse_text('a')
>>> print ast.to_json()
or::
>>> from simplepeg import SPEG
>>> parser = SPEG()
>>> ast = parser.parse('GRAMMAR test b -> "a";', 'a')
>>> print ast.to_json()
--------
To use, simply do::
>>> from simplepeg import SPEG
>>> parser = SPEG()
>>> parser.parse_grammar('GRAMMAR test b -> "a";')
>>> ast = parser.parse_text('a')
>>> print ast.to_json()
or::
>>> from simplepeg import SPEG
>>> parser = SPEG()
>>> ast = parser.parse('GRAMMAR test b -> "a";', 'a')
>>> print ast.to_json()
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
simplepeg-1.0.1.tar.gz
(6.0 kB
view hashes)