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.6.zip (55.1 kB view details)

Uploaded Source

aptk-0.6.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

aptk-0.6.linux-i686.exe (99.3 kB view details)

Uploaded Source

File details

Details for the file aptk-0.6.zip.

File metadata

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

File hashes

Hashes for aptk-0.6.zip
Algorithm Hash digest
SHA256 9b9d9ec80f8a9398cf3061a2ab10f5d3715ab3644fdfadf55af659ab643b30a9
MD5 ef6c2767dc4d1d68583d307eda57995a
BLAKE2b-256 faf26facb2e76bc02bd25d1e4675ef68b9fc99cf6b97826968cebbd99dfa3b76

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.6.tar.gz
Algorithm Hash digest
SHA256 c7595c1b792af1a40d935cc3967682656402a0d8ef4e1f42e62b536ba24ae122
MD5 a19f84bf553d82b614fe0b361e5a2b83
BLAKE2b-256 15d8c5fafd96c615bcff676f856c7195c9a7c2cc03c0488001fec929702bc84c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aptk-0.6.linux-i686.exe
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aptk-0.6.linux-i686.exe
Algorithm Hash digest
SHA256 70b55d3bf9d5a04ff23107daba337d707cfb6fac67d6bbdb850933eca35ba8bd
MD5 2eb8b4f309cf41182c852f25cf804b25
BLAKE2b-256 79dab4c13a9b63f5ec4a471910f0281cb197483bd94d0a8503de7b7adc1996e4

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