lexer class and simple iterator