Path: utzoo!attcan!uunet!yenta!dt From: dt@yenta.alb.nm.us (David B. Thomas) Newsgroups: comp.misc Subject: how to handle include files with lex Summary: I'm writing a compiler and need to have an 'include' feature Keywords: lex include Message-ID: <1389@yenta.alb.nm.us> Date: 7 Jun 90 06:19:32 GMT Distribution: comp Organization: yenta unix pc, Rio Rancho, NM Lines: 12 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