Metadata-Version: 2.1
Name: bootpeg
Version: 0.5.0
Summary: bootpeg – the bootstrapping PEG parser
Home-page: https://github.com/maxfischer2781/bootpeg
License: UNKNOWN
Keywords: parser peg pep617
Author: Max Fischer
Author-email: maxfischer2781@gmail.com
Description-Content-Type: text/x-rst
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Dist: typing_extensions
Requires-Dist: sphinx ; extra == "doc"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: flake8 ; extra == "test"
Requires-Dist: flake8-bugbear ; extra == "test"
Requires-Dist: black ; extra == "test" and ( implementation_name=='cpython')
Requires-Dist: coverage ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Provides-Extra: doc
Provides-Extra: test

########################################
`bootpeg` – the bootstrapping PEG parser
########################################

.. image:: https://readthedocs.org/projects/bootpeg/badge/?version=latest
    :target: https://bootpeg.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/bootpeg.svg
    :alt: Available on PyPI
    :target: https://pypi.python.org/pypi/bootpeg/

.. image:: https://github.com/maxfischer2781/bootpeg/actions/workflows/unittests.yml/badge.svg
    :target: https://github.com/maxfischer2781/bootpeg/actions/workflows/unittests.yml
    :alt: Unit Tests (master)

.. image:: https://github.com/maxfischer2781/bootpeg/actions/workflows/verification.yml/badge.svg
    :target: https://github.com/maxfischer2781/bootpeg/actions/workflows/verification.yml
    :alt: Verification (master)

.. image:: https://codecov.io/gh/maxfischer2781/bootpeg/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/maxfischer2781/bootpeg
    :alt: Test Coverage

> Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

`bootpeg` is a PEG parser for creating parsers – including itself.
By default, it supports a modified EBNF with actions akin to `PEP 617`_.

.. code-block:: bash

    # memoizing bottom-up PEG parser
    $ python3 -m bootpeg.pika.boot

Unlike most other Python PEG parsers which are top-down Packrat parsers,
`bootpeg` provides a bottom-up `Pika parser`_:
it handles left-recursive grammars natively,
allows recovering partial parse results,
and runs in linear time for usual inputs.
This makes it straightforward to define custom grammars without
worrying about their implementation.

Do I need a bigger boot?
------------------------

> Some people, when confronted with a problem, think "I know, I'll use self-writing parsers." Now they have problems+.

If you need a battle-hardened, production ready parser suite
then `pyparsing`_ should be your first choice.
If you are the choosy type, make it your second choice as well.

Pick `bootpeg` when you need safe left-recursion and self-parsing.
It will never bite off your left peg via infinite recursion.
It will take care of itself and all its grammars to make you happy.
`bootpeg` is the friend you need when you know `bootpeg` is the friend you need.

Well, *eventually* it will be; ``bootpeg`` is still a cute little puppy.
Don't let it lift too heavy.
So far it is only lifting itself.

.. _`PEP 617`: https://www.python.org/dev/peps/pep-0617/
.. _`pyparsing`: https://pyparsing-docs.readthedocs.io/
.. _`Pika parser`: https://arxiv.org/pdf/2005.06444.pdf

