Tor Egil Hoftun Kvæstad

— Joy in creation

BNFHaiku

This program was made to make it easy to generate haiku poems, although you don’t have to use it that way. It is a command-line program that accepts a file containing BNF as its command-line parameter. It then uses this to generate output.

For example, the following BNF:

<expr> ::= <foodexpr>, <drinkexpr>.
<foodexpr> ::= <person> eats <food>
<drinkexpr> ::= <person> drinks <drink>
<person> ::= he|she|it
<food> ::= meat|fish|fowl
<drink> ::= water|wine|beer

Produces output like “she eats meat, he drinks wine.”, “he eats fowl, it drinks water.” and “she eats meat, it drinks water.”

The newest version is version 1.1.0, released at 2023-04-13.

System Requirements

Download

Filebnfhaiku-1_1_0.zip (2.1KiB)
Release1.1.0,
MD5-Sum5c8f66b9b2482ef4443e7cc6bd8cd977
SHA1-Sum9d65f94cac83d403f2285bda250ffa7e3e199c85
SHA256-Sum939eacd32782d543d4243e1cd31e8bb134c12eea0dd07847c7e545a2df17398a
GPG Signaturebnfhaiku-1_1_0.zip.sig

Languages

Features

Tools Used

Gnu Emacs, Python 3.10, mypy, pylint.

Changes

Version 1.1.0

Updated the code to Python 3, and to use the argparse module to parse the command-line parameters. Added type hints, and checked the code using mypy and pylint. I found quite a few issues that I fixed, both for the typing and for the code quality.