Internal to the generated lexer, use a stack of PushbackReaders instead of just one. Make this a protected member, so that a derived class can "push" a new input queue. This would be very handy for macros, generics, and include files. Anagon