Ejemplo n.º 1
0
 public void AddSingleValue(IParseTreeValue value)
 {
     if (value.ParsesToConstantValue)
     {
         if (!_valueConverter(value, out T result))
         {
             throw new ArgumentException();
         }
         AddSingleValueImpl(result);
     }
     else
     {
         VariableSingleValues.Add(value.ValueText);
     }
     _descriptorIsDirty = true;
 }
Ejemplo n.º 2
0
        public void Add(IRangeClauseFilter filter)
        {
            var newFilter = (RangeClauseFilter <T>)filter;

            if (newFilter.TryGetIsLTValue(out T isLT))
            {
                AddIsClauseImpl(isLT, LogicSymbols.LT);
            }
            if (newFilter.TryGetIsGTValue(out T isGT))
            {
                AddIsClauseImpl(isGT, LogicSymbols.GT);
            }

            foreach (var tuple in newFilter.RangeValues)
            {
                AddValueRangeImpl(tuple.Item1, tuple.Item2);
            }

            foreach (var val in newFilter.VariableRanges)
            {
                _variableRanges.Add(val);
            }

            foreach (var op in newFilter.RelationalOps)
            {
                AddRelationalOpImpl(op);
            }

            foreach (var val in newFilter.SingleValues)
            {
                AddSingleValueImpl(val);
            }

            foreach (var val in newFilter.VariableSingleValues)
            {
                VariableSingleValues.Add(val);
            }
            _descriptorIsDirty = true;
        }