(flex.info)How can I expand macros in the input?
How can I expand macros in the input?
The best way to approach this problem is at a higher level, e.g., in
However, you can do this using multiple input buffers.
/* Saw the macro "macro" followed by extra stuff. */
main_buffer = YY_CURRENT_BUFFER;
expansion_buffer = yy_scan_string(expand(yytext));
if ( expansion_buffer )
// We were doing an expansion, return to where
// we were.
expansion_buffer = 0;
You probably will want a stack of expansion buffers to allow nested
macros. From the above though hopefully the idea is clear.
automatically generated by info2www version 22.214.171.124