[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The best way to approach this problem is at a higher level, e.g., in the parser.
However, you can do this using multiple input buffers.
%% macro/[a-z]+ { /* Saw the macro "macro" followed by extra stuff. */ main_buffer = YY_CURRENT_BUFFER; expansion_buffer = yy_scan_string(expand(yytext)); yy_switch_to_buffer(expansion_buffer); } <<EOF>> { if ( expansion_buffer ) { // We were doing an expansion, return to where // we were. yy_switch_to_buffer(main_buffer); yy_delete_buffer(expansion_buffer); expansion_buffer = 0; } else yyterminate(); } |
You probably will want a stack of expansion buffers to allow nested macros. From the above though hopefully the idea is clear.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Wolfram Kahl on September, 9 2006 using texi2html 1.76.