Add build_expr for building pattern tree from string