Mathematical expression lexer