public virtual FieldList CreateFieldList(FieldNode fieldLeft, FieldList fields)
 {
     return new FieldList(fieldLeft, fields);
 }
 public virtual FieldList CreateFieldList(FieldNode fieldLeft)
 {
     return new FieldList(fieldLeft);
 }
 public virtual Operation CreateComparationLess(FieldNode field, ValueNode value)
 {
     return new OpLess(field, value);
 }
 public virtual Operation CreateComparationNotEqual(FieldNode field, ValueNode value)
 {
     return new OpNotEqual(field, value);
 }
Esempio n. 5
0
        /// <summary>
        /// Determines the correct oepration.
        /// If the value token after an Equal, is null the correct 
        /// operation is IsNull
        /// </summary>
        /// <param name="field">The field.</param>
        /// <returns>The operation</returns>
        private Operation IsNullOrEqualRule(FieldNode field)
        {
            ValueNode valueNode = ValueRule();

            if (valueNode == null)
            {
                return _astFactory.CreateComparationIsNull(field);
            }

            return _astFactory.CreateComparationEqual(field, valueNode);
        }
 public override Operation CreateComparationIsNull(FieldNode field)
 {
     return new CAMLOpIsNull(field);
 }
 internal CAMLOpContains(FieldNode field, ValueNode valueNode)
     : base(field, valueNode)
 {
 }
Esempio n. 8
0
        /// <summary>
        /// COMPARATION Expression Rule
        ///  | FieldRule COMPARATOR ValueRule
        /// </summary>
        /// <returns>AST Operation Tree</returns>
        /// <exception cref="ParserException"><c>ParserException</c>.</exception>
        private Operation ComparationRule(FieldNode field)
        {
            _token = _scanner.GetToken();

            switch (_token.Ttype)
            {
                case TokenType.LESS:
                    return _astFactory.CreateComparationLess(field,
                                                             ValueRule());
                case TokenType.GREATER:
                    return _astFactory.CreateComparationGreater(field,
                                                                ValueRule());
                case TokenType.LESS_EQ:
                    return _astFactory.CreateComparationLessEqual(field,
                                                                  ValueRule());
                case TokenType.GREATER_EQ:
                    return _astFactory.CreateComparationGraterEqual(field,
                                                                    ValueRule());
                case TokenType.EQ:
                    return IsNullOrEqualRule(field);
                case TokenType.NOT_EQ:
                    return IsNotNullOrNotEqualRule(field);
                case TokenType.IS:
                    return IsNullOrNotIsNullRule(field);

                case TokenType.LIKE:
                    return _astFactory.CreateComparationContains(field, ValueRule());

                case TokenType.BEGINS:
                    return _astFactory.CreateComparationBegin(field, ValueRule());

                default:
                    throw new ParserException(
                        string.Format(CultureInfo.InvariantCulture,
                                      "Invalid Operation at {0}",
                                      _scanner.CurrentPosition));
            }
        }
 internal CAMLOpEqual(FieldNode field, ValueNode valueNode)
     : base(field, valueNode)
 {
 }
 internal CAMLOpIsNull(FieldNode field)
     : base(field)
 {
 }
 internal CAMLOpBeginsWith(FieldNode field, ValueNode valueNode)
     : base(field, valueNode)
 {
 }
 public override Operation CreateComparationNotEqual(FieldNode field, ValueNode value)
 {
     return new CAMLOpNotEqual(field, value);
 }
 public override Operation CreateComparationLess(FieldNode field, ValueNode value)
 {
     return new CAMLOpLess(field, value);
 }
 internal CAMLOpGreater(FieldNode field, ValueNode valueNode)
     : base(field, valueNode)
 {
 }
 public virtual Operation CreateOperation(FieldNode field, ValueNode value)
 {
     return new Operation(field, value);
 }
Esempio n. 16
0
 internal CAMLOpLess(FieldNode field, ValueNode valueNode)
     : base(field, valueNode)
 {
 }
 public virtual Operation CreateComparationBegin(FieldNode field, ValueNode value)
 {
     return new OpBeginsWith(field, value);
 }
Esempio n. 18
0
        /// <summary>
        /// Determines the correct oepration.
        /// If the value token after a distinct operator, is null the correct 
        /// operation is IsNotNull
        /// </summary>
        /// <param name="field">The field.</param>
        /// <returns>The operation</returns>
        private Operation IsNotNullOrNotEqualRule(FieldNode field)
        {
            ValueNode valueNode = ValueRule();

            // TODO: Introduce a class for Null Values
            if (valueNode == null)
            {
                return _astFactory.CreateComparationIsNotNull(field);
            }

            return _astFactory.CreateComparationNotEqual(field, valueNode);
        }
 public virtual Operation CreateComparationIsNull(FieldNode field)
 {
     return new OpIsNull(field);
 }
Esempio n. 20
0
 private Operation IsNullOrNotIsNullRule(FieldNode field)
 {
     _token = _scanner.GetToken();
     switch (_token.Ttype)
     {
         case TokenType.NULL:
             return _astFactory.CreateComparationIsNull(field);
         case TokenType.NOT:
             _token = _scanner.GetToken();
             if (_token.Ttype == TokenType.NULL)
             {
                 return _astFactory.CreateComparationIsNotNull(field);
             }
             throw new ParserException(
                 string.Format(CultureInfo.InvariantCulture,
                               "Missing NULL at {0}",
                               _scanner.CurrentPosition));
         default:
             throw new ParserException(
                 string.Format(CultureInfo.InvariantCulture,
                               "Missing NULL at {0}",
                               _scanner.CurrentPosition));
     }
 }
 public override Operation CreateComparationBegin(FieldNode field, ValueNode value)
 {
     return new CAMLOpBeginsWith(field, value);
 }