Math expression parser