Next: How can I match text only at the end of a file?, Previous: How can I have multiple input sources feed into the same scanner at the same time?, Up: FAQ [Contents][Index]
This is not going to work without some additional effort. The reason is
that flex
block-buffers the input it reads from yyin
. This means that the
“outermost” yylex()
, when called, will automatically slurp up the first 8K
of input available on yyin, and subsequent calls to other yylex()
’s won’t
see that input. You might be tempted to work around this problem by
redefining YY_INPUT
to only return a small amount of text, but it turns out
that that approach is quite difficult. Instead, the best solution is to
combine all of your scanners into one large scanner, using a different
exclusive start condition for each.