# aPTK - A Parse Toolkit¶

aPTK is a Parse Toolkit. It is useful to write documented grammars similar to BNF grammar language.

Typically you would use it like this:

from aptk import *

'''This is the grammar of a simple addition.

<addition> := <operand> <.ws> "+" <.ws> <operand>
<ws>       := \s*
<operand>  := \d+
'''


The most interesting on the grammars derived from BaseGrammar is that they are compiled at compile-time of your python module. This is possible due to some python voodoo with metaclasses in grammar.