A year ago I did some initial work developing a PHP implementation for such
a parser:
http://open-scriptures.googlecode.com/svn/branches/php-prototypes/reference-parser.lib.php
Maybe the algorithms would be of use to you. I only refined it for New
Testament references.
On Fri, Nov 20, 2009 at 5:2
SWORD's ability to parse arbitrary input into a list of verses is awesome. It
is far more powerful than what is needed for an osisID or an osisRef.
The structure of these for biblical references is very well defined.
Here is a partial BNF for it. (I've simplified/extended the BNF with [ ] to
re