private static FilterSpecParamFilterForEvalDouble ResolveFilterIndexDoubleEval(
            string indexName,
            ExprNode indexExpression,
            IDictionary <string, Pair <EventType, string> > arrayEventTypes,
            string statementName,
            ExprEvaluatorContext exprEvaluatorContext)
        {
            FilterSpecParamFilterForEvalDouble resolved = null;

            if (indexExpression is ExprIdentNode)
            {
                resolved = GetIdentNodeDoubleEval((ExprIdentNode)indexExpression, arrayEventTypes, statementName);
            }
            else if (indexExpression is ExprContextPropertyNode)
            {
                var node = (ExprContextPropertyNode)indexExpression;
                resolved = new FilterForEvalContextPropDouble(node.Getter, node.PropertyName);
            }
            else if (ExprNodeUtility.IsConstantValueExpr(indexExpression))
            {
                var constantNode = (ExprConstantNode)indexExpression;
                var d            = constantNode.GetConstantValue(exprEvaluatorContext).AsDouble();
                resolved = new FilterForEvalConstantDouble(d);
            }
            if (resolved != null)
            {
                return(resolved);
            }
            throw new ExprValidationException("Invalid filter-indexable expression '" + indexExpression.ToExpressionStringMinPrecedenceSafe() + "' in respect to index '" + indexName + "': expected either a constant, context-builtin or property from a previous pattern match");
        }
示例#2
0
 public FilterSpecParamAdvancedIndexQuadTreeMXCIF(FilterSpecLookupable lookupable, FilterOperator filterOperator,
     FilterSpecParamFilterForEvalDouble xEval, FilterSpecParamFilterForEvalDouble yEval,
     FilterSpecParamFilterForEvalDouble widthEval, FilterSpecParamFilterForEvalDouble heightEval)
     : base(lookupable, filterOperator)
 {
     _xEval = xEval;
     _yEval = yEval;
     _widthEval = widthEval;
     _heightEval = heightEval;
 }
示例#3
0
 public FilterSpecParamAdvancedIndexQuadTreePointRegion(
     FilterSpecLookupable lookupable,
     FilterOperator filterOperator, 
     FilterSpecParamFilterForEvalDouble xEval,
     FilterSpecParamFilterForEvalDouble yEval)
     : base(lookupable, filterOperator)
 {
     _xEval = xEval;
     _yEval = yEval;
 }