Implement lexer.