public QueryConditionNode(QField lvalue, Conditions conditions, QConst rvalue) : base() { _RValue = rvalue; _Condition = conditions; _LValue = lvalue; }
protected QueryNode ParseCondition(string input, int startIdx, out int endIdx) { IQueryValue leftValue = ParseInternal(input, startIdx, out endIdx); // special case if legacy 'allow dump constants' mode is on if (AllowDumpConstants && leftValue is QConst) leftValue = new QField( ((QConst)leftValue).Value.ToString() ); int nextEndIdx; Conditions conditions = Conditions.Equal; LexemType nextLexemType = GetLexemType(input, endIdx, out nextEndIdx); if (!GetCondition(nextLexemType, input, endIdx, ref nextEndIdx, ref conditions)) throw new RelExParseException( String.Format("Invalid syntax (position: {0}, expression: {1})", startIdx, input ) ); IQueryValue rightValue = ParseInternal(input, nextEndIdx, out endIdx); QueryNode node; if (IsNullValue(rightValue)) { if ( (conditions & Conditions.Equal)!=0 ) { // as for now, use strict casting to appropriate lvalue/rvalue types // node = new QueryConditionNode( leftValue, Conditions.Null | (conditions & ~Conditions.Equal), null); node = new QueryConditionNode( (QField)leftValue, Conditions.Null | (conditions & ~Conditions.Equal), null); } else { throw new RelExParseException( String.Format("Invalid syntax - such condition cannot be used with 'null' (position: {0}, expression: {1})", startIdx, input ) ); } } else { // as for now, use strict casting to appropriate lvalue/rvalue types // node = new QueryConditionNode( leftValue, conditions, rightValue); node = new QueryConditionNode( (QField)leftValue, conditions, (QConst)rightValue); } return node; }