Hi everyone,
I wanted to let you all know I've just posted a macro expansion tool
that we've been using for some time here at the ANU 14UD. It's called
'pymsi'
For now it's in the 'epicsapps' distribution related to pyepics,
although it's really a command line tool that doesn't require any
Python knowledge or even the pyepics libraries (just a working Python
installation.)
Docs at:
http://pyepics.github.com/epicsapps/pymsi.html
Code at:
https://github.com/pyepics/epicsapps
pymsi is a similar tool to "msi", it takes templated input databases
and processes them to produce output databases. Some syntax is even
identical. However, pymsi has several additional powerful features for
compile-time database evaluation:
- Components can be nested hierarchically, allowing individual
databases to be very flexibly reused (the 'DRY' principle[1].)
- Embedded database parser, verifies database syntax at compile time.
- dbd verification allows every field in the database to be checked
against the database definition at compile time, catch pesky errors
and typos early.
- Powerful macro expansion engine - local scopes, inline default values,
errors on missing macros.
- Automatic dependency generator for Makefile integration (changes to
any subdatabase will cause make to automatically rebuild the parent
database.)
- Detailed error messages with accurate line & column numbers for quick
and accurate debugging.
- Easy integration with the EPICS build system.
(More details and an example can be found at the documentation link
above.)
Posting it here in the hope that it's useful to other labs. Please let
me know if I can answer any questions or improve the documentation in
any way.
Cheers,
Angus
[1] https://en.wikipedia.org/wiki/Don%27t_repeat_yourself