Skip to main content

Python bindings for bison/flex parser engine

Project description

PyBison

python versions wheel Build

Welcome to PyBison!
Bringing GNU Bison/Flex's raw speed and power to Python

What is PyBison?

PyBison is a framework which effectively 'wraps' Bison and Flex into a Python class structure.

You define a parser class, define tokens and precedences as attributes, and parse targets as methods with rules in the docstrings, then instantiate and run.

Black Magick happens in the background, whereupon you get callbacks each time yyparse() resolves a parse target.

Install

Now, install pybison with:

pip install pybison

The following command will verify if the installation succeeded:

python -c "import bison"

There are already parsers for Python. Why re-invent the wheel?

I looked at all the Python-based parsing frameworks.

IMO, the best one was PLY - a pure-python lexx/yacc implementation (which I have borrowed from heavily in designing PyBison's OO model).

But PLY suffers some major limitations:

  • usage of 'named groups' regular expressions in the lexer creates a hard limit of 100 tokens - not enough to comfortably handle major languages
  • pure-python implementation is a convenience, but incurs a cruel performance penalty
  • the parser engine is SLR, not full LALR(1)

The other frameworks utilise a fiddly script syntax -

How do I use this?

Refer to the examples and the docs for usage.

Development

You will need:

We assume that Python, pip and a C compiler is already installed.

Dependencies

First, install the dependencies bison and flex.

Arch Linux

sudo pacman -S bison flex

Ubuntu

sudo apt-get install bison flex

Windows

With Chocolatey, you can install the packages as follows:

choco install winflexbison3

Additionally, if a C compiler is needed, mingw can be installed with Chocolatey as well.

choco install mingw

Debugging

See the short introduction into debugging.

Collaborators

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

pybison-0.6.3.tar.gz (35.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pybison-0.6.3-cp311-cp311-win_amd64.whl (376.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pybison-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (573.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pybison-0.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (573.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.24+ ARM64

pybison-0.6.3-cp311-cp311-macosx_11_0_arm64.whl (242.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybison-0.6.3-cp311-cp311-macosx_10_9_x86_64.whl (261.5 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pybison-0.6.3-cp310-cp310-win_amd64.whl (269.7 kB view details)

Uploaded CPython 3.10Windows x86-64

pybison-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (455.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pybison-0.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (449.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.24+ ARM64

pybison-0.6.3-cp310-cp310-macosx_11_0_arm64.whl (243.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybison-0.6.3-cp310-cp310-macosx_10_9_x86_64.whl (153.8 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pybison-0.6.3-cp39-cp39-win_amd64.whl (379.2 kB view details)

Uploaded CPython 3.9Windows x86-64

pybison-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (690.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pybison-0.6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (692.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

pybison-0.6.3-cp39-cp39-macosx_11_0_arm64.whl (246.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pybison-0.6.3-cp39-cp39-macosx_10_9_x86_64.whl (265.7 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pybison-0.6.3-cp38-cp38-win_amd64.whl (383.0 kB view details)

Uploaded CPython 3.8Windows x86-64

pybison-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (712.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pybison-0.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (713.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

pybison-0.6.3-cp38-cp38-macosx_11_0_arm64.whl (245.8 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pybison-0.6.3-cp38-cp38-macosx_10_9_x86_64.whl (266.0 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pybison-0.6.3-cp37-cp37m-win_amd64.whl (375.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

pybison-0.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (522.0 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

pybison-0.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (520.3 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

pybison-0.6.3-cp37-cp37m-macosx_10_9_x86_64.whl (261.6 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file pybison-0.6.3.tar.gz.

File metadata

  • Download URL: pybison-0.6.3.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3.tar.gz
Algorithm Hash digest
SHA256 892ce156ebe185565e061b041f32c8defa7a61e7de3428a646b4b66f314b1373
MD5 bca71532482fed8181feb456b4a0ed36
BLAKE2b-256 72401f908ae261b650b45192d92c738d412ca86ebbabc46fa555b1380b0e67ae

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pybison-0.6.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 376.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4bacacf814ec3762fff9f5bbf695b5b9e629d21a71b3691350ce53edd66bd47b
MD5 2f664b1fe5e5c859b7c36b303e6f74d3
BLAKE2b-256 580b3d74fe2e9e26c59311450cfd2726e9077127191daa5c39f15614ff9b37e0

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2391bd59117afd841167b0d618845f2114eb9e532dcd2f7763f9e901e4cf57fa
MD5 2cfeb8cbc3a0264f3ba2989da5dec74b
BLAKE2b-256 276261febb0de9c9eec7a2c477fabe8d0965b5888a971662087772d8165c6665

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 1c0bf4f192f87d3b271909952fdbbedd3cf418c01599646daa0fb096c367595a
MD5 adb2d2a4013079dfb8feffa262d0d2e1
BLAKE2b-256 688bef34a65f7ac1e4860bbec4cf21a96037a8eb99bb1cdcf859b24ceeda0403

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a964a46c97370ee0bf936b7d041eb5ee880f46c65290671c1c9d5128c948ed38
MD5 fb38cc436fdf1da5757c054d0dd45cbc
BLAKE2b-256 21e0407f4db28f4f9886b3cd36e79d15cda3e3b597706bee76863011e8220b2f

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 059b9ef6084778d17f276984aeaea132570dd4454036f8e3e8a2b902f0cc02fc
MD5 783be54cb7d5d757d4202556ee0f48a2
BLAKE2b-256 bb3167fc772f1d2076bb04a062e5ecb54919786f150fed1b4a94c4d1c7ac08c6

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pybison-0.6.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 269.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c81f6d913bd138879d29b89069814e5aeaa20577523219dd63e62b415ec2bbcf
MD5 9cc2831ddf3462698b4885e57118390b
BLAKE2b-256 bc4995b7a2547ccdc7b596185d19f40d6fb354e2269448bec25094a8622b3d00

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6029d78209ad6c91b93dcb894bdc2ead577d3a020cc9f75b7a66e342561ad8a0
MD5 9e975101814607e1714fa1bba62e3fff
BLAKE2b-256 09223e7236f079b041a4c277898c8b488defd86696ae5866b6b607d69493db9c

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 39fe412bd7cb3e14fe86a4a58d4458d38ad1651e41cff3bd89768a2db10ff786
MD5 a2829e6a403850d45db09933339210f6
BLAKE2b-256 c7f0fb4d91770310f538dd137a9159a97b4648ce5a864b2647e0ead5b809c754

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7fcbf00b17ba78e2a56ff0164abbe08756427764b55df7ceac726a061a06b019
MD5 0426e95552a27b8c23ac6aae83b4abc9
BLAKE2b-256 db28731920a434a3d8a41093ce395ae93b2669dfcfd2bdce3d3715156cfe0b8b

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2ef2a9e0727492aff7bdf2ca5b3218e679c9ca2f4ae80397748537154af62cb3
MD5 88f810cbfc157f3edd3b8d88de9e7796
BLAKE2b-256 ce5f4eda22d82e2619714030ca47c895275367c748865abb55b3a9c62cb6a595

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pybison-0.6.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 379.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 499c0350200df695091dfea36497927a80b233c191dbc2dcc31e8e195801cbbc
MD5 ac67012e5911ca9ab9d3e8a526bd4101
BLAKE2b-256 a9625b6c361d932e6971996b20a6ad7c90183a0a8ecf329435d890b5a268b3cc

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8692ca833c507b24a3bfd12607198b5a3d63f876e5686de5dac34bd9e7fdb31
MD5 f7aa0ad3ec211bfda1e484e2f791444e
BLAKE2b-256 73481717b960b2571cb49a7b519a9eee8960efd097dbf6e5cc89130590bdc7e4

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 47ab7135f613af87ff2fb34d059933bb8e696b4d9febdebe5e9dcc44c417db4d
MD5 1de6afbbfc7ff14f9f86693a9d781d9a
BLAKE2b-256 9af6a1700e58c836d5ed4a158f34413e9575cdc877b031192cd62d663e75edea

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a22d71acc6e7eab3e06a72508b73d3b6e1065ba7abf2a7c2f31210e8ba3498d8
MD5 f7d6569b211d2a996615f76536c6a258
BLAKE2b-256 3e64de09997507a72e5eb8a2bb1f1927df93259a33d03f7ecfa91f650a59c643

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1457d47f27b0bef9ba8fd9c8c9168de98f8012508ef66a1cdde3caebaaacce58
MD5 5b13af3c70b71403c7f23af8b9009f5c
BLAKE2b-256 a1c1a2c46df8094ffae132c411f91a68a917b8bea350b73ecd59465fedd4b67c

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pybison-0.6.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 383.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3490dee1d979526eac7d80b639b6dc134a0cbbe1b3edef1d68de2acd692d2549
MD5 7a66ce9b4c2f0216e85e1a6663ff435e
BLAKE2b-256 7f715105e2bc561e5611642599084584f5761507904c6933baf1c400eff60120

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f27a5807ba756450406ed83560e2875235cb45f6d733fcdecfdf9d5437df379
MD5 e4a03ae52a8a4dc879e67061bc3d1da4
BLAKE2b-256 1957fbddb7a74f6c2a83acc03d6122744add412b20c2865ddc32f5a2bc293daf

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9c5b2008596ca8377dfe25f486ac56847bc8384287f5d864f8d2760ede0de3e5
MD5 2b456c3e16205ec19d9c436018b67fb8
BLAKE2b-256 d360606985d4044462a032c102b78100ae0df425adfd1cef2a4485934b5e4fb5

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cedb7c8fc2c810df08d819c7cfef812733959a6923eda4f698fdec5132ebce16
MD5 73831e4cdf1412b0efe3d7d28a9ccd0b
BLAKE2b-256 a8852fca5bdeeac8afa10609de882d10fc678a1dafe7e9b50a05469295431f7a

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b874d12bf2d2eda67be658a9be03d748f2376a8126c89282e4fb3978f65c3895
MD5 1b504b3048920b3920b6430b4efd65f7
BLAKE2b-256 6a8274564a5f484a37a72aaa52cb3dfb658f4ea43207e028efe3d0172d840db2

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pybison-0.6.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 375.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for pybison-0.6.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6955cfff9bfdfc19685177e8c6ecd82d72e3cebfe3eaaa92c1059c1bc68944e1
MD5 8d80090c27af7d5dab7e4c299414f64e
BLAKE2b-256 0561ce5123c26d0d415129522510ffb6fc8ecd130728872ebf428019ab19df3e

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ece891ad5870fb88cabe9bf58dd9b9835cc54b9685834166477eb40b5fe6d5b1
MD5 c84de09a77defb67b961a891a293c21b
BLAKE2b-256 e6523f42531b699aca83274843026b88f93dadf569d535ee4ebddbc0e7b8c2b8

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aed585d493fd0ea12dd13a8c54b616e2fb08361ac90950649552d3a8fb0ba118
MD5 501fe1240d860fdca4f7dcbc08ff6bcf
BLAKE2b-256 f8626f24c7116868066e3de0ffb8187d59ff1b1f25f044279f53184036ed1d02

See more details on using hashes here.

File details

Details for the file pybison-0.6.3-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybison-0.6.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bea33408ac9ad8aeabff920174ff6975b07c676df379d203366679cb95551c5e
MD5 377a12badffbf31da74cbd3ec4b3a32a
BLAKE2b-256 7d09f18b703cf71819da5733490b1b5dd50f656727b36239b0e75636c5432f9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page