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.4 first tests for postcircumfix pass, more tests, cleaned code a bit

0.5.3 Added operation precedence parser. Pretty simple yet, but supports
infix, postfix, prefix, circumfix operations. postcircumfix is
also implemented but not tested at all others are partly tested.

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.4.zip (51.9 kB view details)

Uploaded Source

aptk-0.5.4.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

aptk-0.5.4.linux-i686.exe (96.6 kB view details)

Uploaded Source

File details

Details for the file aptk-0.5.4.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.4.zip
Algorithm Hash digest
SHA256 78049aae32ee9b4903cad79a1c9f5f44375901e3b470694cffea30710c873acf
MD5 317e5f838fd02524d4fd9c37a3658f9e
BLAKE2b-256 7df81057642e583fac5bf09b4545cc27199187f39f15b713305ade1aae8cd325

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.4.tar.gz
Algorithm Hash digest
SHA256 fce8dfe225b51932c6941db5e5695da75e59558c6935118a73e779f063328849
MD5 b38889501e54357bc4595f0e34c21655
BLAKE2b-256 30f8772b23c35f205f2f05db8272ae7e1e0acd92bdefcd5ef6f9116b0bf23e19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.4.linux-i686.exe
Algorithm Hash digest
SHA256 1990bdac2999fe4bbdc906a9a2f7b8f2e2135c9273b5781df121139cb15ef071
MD5 481a2e43129ce81027fd346b02234fe2
BLAKE2b-256 d08e5201c3f826ace7f6c4e143aa53b7ad229fa5b9de1d55ee3e62221a1cde48

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