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.0.zip (46.1 kB view details)

Uploaded Source

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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

Details for the file aptk-0.5.0.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.0.zip
Algorithm Hash digest
SHA256 89a81fb54aeb46f28b1fa294205250e08eb117e4b0e3867e11e27527a7c82f9a
MD5 e94fa59fbe3417cc024e9952f1038d74
BLAKE2b-256 51428a95b8f41c341e912ede23c27fdbac2c438dcc74e9bf6162368b6ff74881

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 44d34aa38e3c0ca2d161a00f6ed2d2bdcbf1ad25943cd7d88b9dffb525a908f6
MD5 5d2c98cf1b158aa7ca7c7e8032abdba9
BLAKE2b-256 c0e19403d136b173a0ee2ba8cd0b4ee0443355c7ab2974cbe9f051f76ae7167f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.0.linux-i686.exe
Algorithm Hash digest
SHA256 ee26286a3469133759bb546588ef17bf1b473c43a0bbb91405eab114c0dca839
MD5 831edc5313ef9209a1e389082b40dfb4
BLAKE2b-256 0eedc05a4dddda4462ce327bae30fc49b96b4f3196c0552e0ac9bfcc38d6d7f4

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