/// <summary> /// Initializes a new instance of the <see cref="MathExpressionFunctionNode"/> class. /// </summary> /// <param name="expressionType"></param> /// <param name="functionNameFragment">The function name fragment.</param> /// <param name="subNodes">The sub nodes (parameters).</param> /// <param name="function">The delegate to calculate function value.</param> /// <exception cref="ArgumentException">null sub node</exception> public MathExpressionFunctionNode( ExpressionTypeDescriptor expressionType, ISourceCodeFragment functionNameFragment, IEnumerable <IParsingProduct> subNodes, Func <object[], object> function) : base(expressionType, functionNameFragment, subNodes) { _function = function; if (SubNodes.Cast <IExecutableExpressionNode>().Any(n => n == null)) { throw new ArgumentException("null sub node"); } }