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.5.zip (54.6 kB view details)

Uploaded Source

aptk-0.5.5.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Source

File details

Details for the file aptk-0.5.5.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.5.zip
Algorithm Hash digest
SHA256 f268c009b5d13bf62ec97a63575aa93c774512e644ace381b2cb405bef65966c
MD5 217be0fb975f51e075f1296da80cae8d
BLAKE2b-256 ec156522ebf3e7910e30517cec0ae4a9a00e8ec5c3739183ed27a9f1fbcb18e8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.5.tar.gz
Algorithm Hash digest
SHA256 8b6aaa7c9dd3b0f40dbc23414e7b20d18aada4552bfcd22b2febad7dae7e2589
MD5 49024a283e577652877993f68aa58950
BLAKE2b-256 98e23966bc0552b22041e0bd5a82ad789ff23821ae20f4cf979fffc854c76261

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.5.linux-i686.exe
Algorithm Hash digest
SHA256 4921fee64c10cd7d0ccd032fd424f37d650a7ce48cc69b1736ac2e1b0c0fb1e1
MD5 a7fd9e6043b4cb689cd1da683be8456f
BLAKE2b-256 13ffa0ec5887ab186797b8ef3a21290e428345e371a3d2845bbef3344c128d1a

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