Implement the lexer.