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.
======= =================================================================
======================
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
Release history Release notifications | RSS feed
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.3.zip
(56.1 kB
view details)
aptk-0.6.3.tar.gz
(46.6 kB
view details)
Built Distribution
aptk-0.6.3.linux-i686.exe
(100.1 kB
view details)
File details
Details for the file aptk-0.6.3.zip
.
File metadata
- Download URL: aptk-0.6.3.zip
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 838a342eb50490ef86059537d0e9e596b92574b2b74e5ac0c44f2bc42267d491 |
|
MD5 | b247bd86e9721706a6ef0ef957ae5f86 |
|
BLAKE2b-256 | 4a7ae7609d8ba503c15e78e16d444bf7e2b7acd4e81a8539c469c288a7513454 |
File details
Details for the file aptk-0.6.3.tar.gz
.
File metadata
- Download URL: aptk-0.6.3.tar.gz
- Upload date:
- Size: 46.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bedbece700d0637b946541387857fbbf25bebfff2037e896feb53e12e7a7594 |
|
MD5 | 8189f43188b801fdc8cb32e797ee8ff2 |
|
BLAKE2b-256 | 6afe73e15fffa7be666b9f146a27e4cd1bfe1f749a09724a8868b10c60488dc0 |
File details
Details for the file aptk-0.6.3.linux-i686.exe
.
File metadata
- Download URL: aptk-0.6.3.linux-i686.exe
- Upload date:
- Size: 100.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b25334c299f64e5664e634d95605cc015ad3c618e6df28e14e5de0e00583860f |
|
MD5 | 31631b31ce19438967a422014be4e322 |
|
BLAKE2b-256 | 4f4f299d63a2dcdf15ac2b9c0d83a19605ccf33702834a65e62810bfaf558290 |