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 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.2.zip (46.4 kB view details)

Uploaded Source

aptk-0.5.2.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

aptk-0.5.2.linux-i686.exe (90.6 kB view details)

Uploaded Source

File details

Details for the file aptk-0.5.2.zip.

File metadata

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

File hashes

Hashes for aptk-0.5.2.zip
Algorithm Hash digest
SHA256 7936973378dd464a8db950830c826964aa10e57303b00aac3bcf71346ae693a1
MD5 d62b7f8c4493b276b05b3127f187fb6e
BLAKE2b-256 6c3db1928951ee3173bc0d5e04753a22deb48996b8a00c29861c86658481689a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aptk-0.5.2.tar.gz
Algorithm Hash digest
SHA256 854a4496f0be7498069296b97b384de588619b5b6972a7426debeb1c0a6691f3
MD5 76ddb85cffa69f9aa43029aa04e73190
BLAKE2b-256 58b729034e879ad5905fc277ff150c387ac10dd1b4ae81b5c46780540d114a1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptk-0.5.2.linux-i686.exe
Algorithm Hash digest
SHA256 debc60feb5378c32d23908dcc7f9226e580077d015d4c861b56f5592c8f3b8b0
MD5 eccce538d517e3dfd86f910b7b973575
BLAKE2b-256 6d279e8f51429eaf1a53c9b9eb6ff91aa420fc800eafbb846db57a1d0afac219

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