First, macros such as in C are considered a bad idea these days. You may
start out with a simple use case, and for that, they are quite simple
and straightforward, but then you add more use cases, and it gets more
and more complex. As far as I know, newer languages all avoid macros.
Most of what is done with macros in C can be done in the language in
C++, for example.
Second, if you really decide to have some macro language, then this is a
separate step of (pre)processing. You may be able to use treetop for
both steps, or may want to use it only for one or the other step. For
very simple macros, you may be able to get away with a script based on
pure ruby and regular expressions, but that won't last long. Using a
different parsing formalism for preprocessing and for the actual
processing may help in some cases, but usually, it's easier for you as
the programmer to use the same formalism twice.
Regards, Martin.