Next: How do I execute code at termination?, Previous: How do I abandon a file in the middle of a scan and switch to a new file?, Up: FAQ [Contents][Index]
You can specify an initial action with %option user-init
(though note that yyout may not be available at the time this
option is interpreted). Or you can add to the beginning of your rules
section:
%%
%{
static bool did_init = false;
if ( ! did_init ) {
do_my_init();
did_init = true;
}
%}