Implement double buffered lexer