hum-parser
is a repository of data definitions, data structures, and functions
for parsing Humdrum files.
hum-parser
is written in the Racket language.
hum-parser
is able to parse a Humdrum file into records and spines, allowing
the user to write these data into new files for use with other programs, or for
use directly (i.e. without writing) with other parts of the hum-parser
.
The ultimate goal of hum-parser
is to map spines on to
graph data
structures. Such structures enable the user to write new functions that traverse
Humdrum data without having to worry about parsing records or spines.
hum-parser
also provides command-line tools.
Racket is a LISP-dialect. It is multi-paradigm, but hum-parser
is chiefly
functional.
Read more on the language here.
Consult the documentation here.
To install Racket, follow the Getting Started page of the documentation.
After installing Racket, it is recommended that the user add the path to the bin
directory to their shell's environment file (where X\.XX
is the version number):
export PATH=/Applications/Racket\ vX\.XX/bin:$PATH
After installing Racket, the hum-parser
repository should be cloned in the
collects
directory:
cd /Applications/Racket vX.XX/collects
git clone https://github.com/bel28kent/hum-parser
Racket automatically searches the collects
directory when a module is imported.
This simplifies paths:
(require hum-parser)
If one clones hum-parser
somewhere else, then the path to the parser will need
to be specified relative to the REPL or importing file:
(require "../PATH/hum-parser/main.rkt")
To install the binaries for the command-line tools:
cd /Applications/Racket vX.XX/collects/hum-parser
make all
hum-parser
may eventually be translated into Racket's sister language Typed
Racket to allow for type-checking of user-defined types such as HumdrumFile
and GlobalSpine
.