Experimental m4 replacement
| File | Size | Last modified | Description | Requirements and optionals | |
|---|---|---|---|---|---|
|
|
47¼ KB | 2006-Jul-26 | Source | ISO C++98 Boost C++ Libraries | |
I got bored waiting for a mythical GNU m4 1.5 ;-), so I wrote my own — a macro processor similar to m4. It's not exactly the same, and it is certainly incomplete, but you might be interested in trying it. However, it is still very much experimental (and might forever stay that way), so don't expect to do any serious work with it yet.
Mokvino has the following features:
Hard quotes and Unicode escape sequences are supported through the use of a preprocessor, which converts the input string into a hierarchical structure according to the level of soft quoting.
There are also quotes which strip leading and trailing internal white space.
Named arguments are supported to allow flexibility in the order of arguments. Named arguments can also be given default values, or be initialized from the initial positional arguments.
Most of the built-in macros, those which generate output for further processing, have a default argument which allows the output to be surrounded by extra quotes.
There are new replacement marks (such as
$!?@) to help to deal with named arguments
and other improvements.
Output can be switched to different files during the processing. External post-processors can be applied to each of these files, controlled by the input script.
Mokvino can automatically generate dependency rules by keeping track of input and output files. It can also be made to write a file only if its contents have changed, list generated files, and remove files it generated previously if not regenerated.