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.7 add comments

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.8.zip (54.7 kB view details)

Uploaded Source

aptk-0.5.8.tar.gz (45.3 kB view details)

Uploaded Source

Built Distribution

aptk-0.5.8.linux-i686.exe (98.7 kB view details)

Uploaded Source

File details

Details for the file aptk-0.5.8.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.8.zip
Algorithm Hash digest
SHA256 69dd66da6dd13e47f4e61767638f8fd953490b2773c4ee232660b3fd2201206e
MD5 d404cce5df1d02ab9445102d25bb6ac8
BLAKE2b-256 3cff4dd3ab7e9c3fa9cb0cdab92e00b05b422c476e6e9d4801ddff128625d529

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.8.tar.gz
Algorithm Hash digest
SHA256 b8043127a8022b8d387905addb2015b0e4a37ad7991357088c4631cad6f26eca
MD5 e26020d1e7a3fb09c1c4f7c3b37b49fc
BLAKE2b-256 6eec2d6b0222cf85c128d574c8ff3d94668207b2e41addf37edf3d49ca3aab47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.8.linux-i686.exe
Algorithm Hash digest
SHA256 ce4efcb2f2ebcc6c405946f9432e40376706aa658e5fa9fcd693cff340ebdeed
MD5 14fccf3a08f93844406545ea8ce37c6a
BLAKE2b-256 957ea2bb64b03419eaf1144c5ac05a6cc4a70c0c7f42c4ac774a73456ca82f41

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