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.9.zip (54.8 kB view details)

Uploaded Source

aptk-0.5.9.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

aptk-0.5.9.linux-i686.exe (98.8 kB view details)

Uploaded Source

File details

Details for the file aptk-0.5.9.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.9.zip
Algorithm Hash digest
SHA256 6e81930eee84ee5391606473f9ca80198c121063182abd6359f1a396b8700957
MD5 3b29b973c81247ad897cef0dce159fd0
BLAKE2b-256 6516c6fdc52e64bd43a6346cea0268f2925b7a43567a7893d3699a7865782cb9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.9.tar.gz
Algorithm Hash digest
SHA256 89bdcc9ca65d15f4038c7feb031f6e7e460fd20b47864d9b25653fef8edcf039
MD5 6e59ebd222b470923eedcc40153463a3
BLAKE2b-256 c6be52373f0f1c17f4a92d20d5ab8b5802b411124159911fa9d33ec7720040ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.9.linux-i686.exe
Algorithm Hash digest
SHA256 58061d3f3e57d9d324bdef21ff30a897954816a3baeae1a44c6b6bf81f2ef78b
MD5 4f7baf9b2d0bd4ea4a719c676fbc7f14
BLAKE2b-256 57eb6735492804ff5a32212d0cdf023a8703dcbef9834f4e8992d7fdfa82e755

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