Implement lex()