(flex.info)Can I build nested parsers that work with the same input file?


Next: How can I match text only at the end of a file? Prev: How can I have multiple input sources feed into the same scanner at the same time? Up: FAQ
Enter node , (file) or (file)node

Can I build nested parsers that work with the same input file?
==============================================================

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.


automatically generated by info2www version 1.2.2.9