Parsing a reverse Polish expression