The Nom project can be downloaded from https://github.com/Geal/nom. This repository also contains some examples.
There are many textbooks about formal languages and about the software that manipulates them. In particular, you may search Wikipedia for the following terms: compiler-compiler, parser combinator, Backus-Naur form, syntax-directed translation.