public override CompileResult Execute(IEnumerable<FunctionArgument> arguments, ParsingContext context) { ValidateArguments(arguments, 3); var condition = ArgToBool(arguments, 0); var firstStatement = arguments.ElementAt(1).Value; var secondStatement = arguments.ElementAt(2).Value; var factory = new CompileResultFactory(); return condition ? factory.Create(firstStatement) : factory.Create(secondStatement); }
private CompileResult CompileRangeValues() { var result = _excelDataProvider.GetRangeValues(ExpressionString); if (result == null || result.Count() == 0) { return null; } var rangeValueList = HandleRangeValues(result); if (rangeValueList.Count > 1) { return new CompileResult(rangeValueList, DataType.Enumerable); } else { var factory = new CompileResultFactory(); return factory.Create(rangeValueList.First()); } }
private CompileResult CompileRangeValues() { var result = _excelDataProvider.GetRangeValues(ExpressionString); if (result == null || result.Count() == 0) { return(null); } var rangeValueList = HandleRangeValues(result); if (rangeValueList.Count > 1) { return(new CompileResult(rangeValueList, DataType.Enumerable)); } else { var factory = new CompileResultFactory(); return(factory.Create(rangeValueList.First())); } }
public NumericExpressionEvaluator(ValueMatcher valueMatcher, CompileResultFactory compileResultFactory) { _valueMatcher = valueMatcher; _compileResultFactory = compileResultFactory; }