Tentative parser for NEURON .mod files using pyparsing.
If you are interested in doing anything complex (e.g. transpiling) with the parsed file, consider using the pynmodl project, which provides better infrastructure and sample compilers (at the moment, mod->LEMS, unparser).
The code in master already parses a number of garden-variety modfiles. Given our more ambitious goal of compiling mod to LEMS, and that parsing is just a small part of compilation, we have decided to adopt a 'language-workbench' approach with textX which can be found at https://github.com/borismarin/pynmodl.
See also:
https://www.neuron.yale.edu/neuron/static/docs/help/neuron/nmodl/nmodl.html
http://cns.iaf.cnrs-gif.fr/files/scopman.html
https://www.neuron.yale.edu/neuron/static/papers/nc2000/nmodl400.pdf