Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You may want to have lexers for two partially or entirely different token syntaxes in the same program. For example, an interactive debugging interpreter might have one lexer for the programming language and use another for the debugger commands.
There are two basic approaches to handling two lexers in one program: combine them into a single lexer or put two complete lexers into the program.