Simple lexer implementation