From http://cdn.bitbucket.org/muspellsson/rosetta/downloads/prolog-bnf.html