Skip to main content

A Parse Toolkit. Create well documented grammars.

Project description

aptk - A Parse Toolkit
======================

This is a module for creating parsers from grammars. aPTK targets to make
this in a very "documented" way. So you can define the grammar in doc-string
of your grammar class or even in your reStructuredText documentation.

.. highlight:: aptk

A simple example of a greeting parser::

:grammar GreetingGrammar

<greeting> := <greeting-clause> <.ws> <greeted>
<ws> := \s+
<greeting-clause> := "hello" | "hi"
<greeted> := \w+

This will create a class named `GreetingGrammar`. First rule in the
grammar will be used as start-rule for a normal parsing. Parsing a
rule, will result in a ParseTree. Here follows an example of rule
``<greeting>`` matching "hello world"::

<greeting> ~~ "hello world"
-> greeting(
greeting-clause( 'hello' ),
greeted( 'world' )
)

Actually what you see above is a test assertion for applying rule greeting
to string "hello world", what is expected to result in the parse-tree
displayed above.

But read more in `aptk's documentation`_.

.. _aptk's documentation: http://aptk.readthedocs.org

Download
--------

You can download this package from PyPI_.

.. _PyPI:: http://pypi.python.org/pypi/aptk#downloads

.. highlight:: bash

Or install it with easy_install::

easy_install -U aptk

or get the the source from source code repository from bitbucket.org::

$ hg clone https://bitbucket.org/klorenz/aptk


Building Documentation
----------------------

For building documentation you need sphinx, you can get it using::

$ easy_install -U Sphinx

Then you can::

$ cd docs
$ make html
$ firefox _build/html/index.html


License
-------

Licensed under New BSD License, see LICENSE.txt.


Release Notes
-------------

======= =================================================================
Version Notes
======= =================================================================
0.5 Starting with version 0.5, which shall indicate, that there is
still a lot to do.

Especially documentation is far from complete and it contains
some passages, which are already outdated.

Next releases will focus on documentation and testing and adding
an operator precendence parser.

======= =================================================================

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

aptk-0.5.1.zip (46.1 kB view details)

Uploaded Source

aptk-0.5.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

aptk-0.5.1.linux-i686.exe (90.3 kB view details)

Uploaded Source

File details

Details for the file aptk-0.5.1.zip.

File metadata

  • Download URL: aptk-0.5.1.zip
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aptk-0.5.1.zip
Algorithm Hash digest
SHA256 6ceaa03cd65a6cf55b8690643c2af7cba52c669891669e1c1bbde32a48426565
MD5 9da9fddd5a894c83a95a4a58d0bb78c8
BLAKE2b-256 5791cd3f65f4d02c7cf457de85753726415401d14baef06921c54361e199e150

See more details on using hashes here.

File details

Details for the file aptk-0.5.1.tar.gz.

File metadata

  • Download URL: aptk-0.5.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aptk-0.5.1.tar.gz
Algorithm Hash digest
SHA256 136b72ee33c66fb394afab3057a71a396d74a58f24629c28842f6fa10ce67f5d
MD5 272f5892d24f0d1d19422f3d61b67d65
BLAKE2b-256 1872e214d4ed651228b3590ff63a99137f5ae876c928b3e8082949296a132591

See more details on using hashes here.

File details

Details for the file aptk-0.5.1.linux-i686.exe.

File metadata

File hashes

Hashes for aptk-0.5.1.linux-i686.exe
Algorithm Hash digest
SHA256 b902f09ce0ba4570c51e97037630998e4ddffbd12a69a53718595c9745628f30
MD5 433b89f7d1f2a6ccb8fddba0b7e1f4be
BLAKE2b-256 9815d8edb39f220f463a91267d957952a9a2eb23024da32151659b4aa1c76825

See more details on using hashes here.

Supported by

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