[comp.misc] how to handle include files with lex

dt@yenta.alb.nm.us (David B. Thomas) (06/07/90)

I need to know if there is a good way to handle an 'include' construct
with lex/yacc.  I am writing a compiler which needs to be able to tokenize
the input until BANG! it encounters an 'include filename' construct.  Then
it should save its place, tokenize from the new file until EOF, then resume
reading the original file.

I tried saving yyin, but that doesn't work, since lex grabs whole buffers
at a time.  Ideas, anyone?  This should be easy, and it must be possible.

						David
					dt@yenta.alb.nm.us