public static MemberBinding FoldBinding(MemberBinding inputExpression)
        {
            switch (inputExpression.BindingType)
            {
            case MemberBindingType.Assignment:
                return(ConstantFolding.FoldMemberAssignment((MemberAssignment)inputExpression));

            case MemberBindingType.MemberBinding:
                return(ConstantFolding.FoldMemberMemberBinding((MemberMemberBinding)inputExpression));

            case MemberBindingType.ListBinding:
                return(ConstantFolding.FoldMemberListBinding((MemberListBinding)inputExpression));

            default:
                throw new DocumentQueryException(string.Format(CultureInfo.CurrentUICulture, "Unhandled binding type '{0}'", inputExpression.BindingType));
            }
        }