Stream-based Lexer