implementing lexer