コード例 #1
0
        private IValue ParseSearchFunctionExpression()
        {
            NPathSearchFunction search = new NPathSearchFunction();

            search.FunctionName = tokenizer.GetCurrentToken().Text;

            tokenizer.MoveNext();
            tokenizer.GetCurrentToken("(", "(");
            tokenizer.MoveNext();
            NPathIdentifier path = new NPathIdentifier();

            path.Path = CurrentPropertyPrefix + tokenizer.GetCurrentToken("property path", "Property path").Text;             // do not localize

            path.ReferenceLocation = IsInSelectClause() ? NPathPropertyPathReferenceLocation.SelectClause : NPathPropertyPathReferenceLocation.WhereClause;
            //	CurrentQuery.AddPropertyPathReference(path.Path) ;

            search.PropertyPath = path;
            tokenizer.MoveNext();
            tokenizer.GetCurrentToken("comma", ",");
            tokenizer.MoveNext();
            tokenizer.GetCurrentToken("string", new string[] { "\"", "'" });
            search.SearchString = (NPathStringValue)ParseValue();

            tokenizer.GetCurrentToken(")", ")");             // do not localize
            tokenizer.MoveNext();

            return(search);
        }
コード例 #2
0
        protected virtual void EmitExpression(IValue expression)
        {
            if (expression is NPathNotExpression)
            {
                NPathNotExpression value = (NPathNotExpression)expression;
                EmitNot(value);
            }
            if (expression is NPathFunction)
            {
                NPathFunction value = (NPathFunction)expression;
                EmitFunction(value);
            }
            if (expression is NPathParameter)
            {
                NPathParameter value = (NPathParameter)expression;
                EmitParameter(value);
            }
            if (expression is NPathNullValue)
            {
                NPathNullValue value = (NPathNullValue)expression;
                EmitNullValue(value);
            }
            if (expression is NPathBetweenExpression)
            {
                NPathBetweenExpression value = (NPathBetweenExpression)expression;
                EmitBetween(value);
            }
            if (expression is NPathBooleanValue)
            {
                NPathBooleanValue value = (NPathBooleanValue)expression;
                EmitBooleanValue(value);
            }
            if (expression is NPathDecimalValue)
            {
                NPathDecimalValue value = (NPathDecimalValue)expression;
                EmitDecimalValue(value);
            }
            if (expression is NPathDateTimeValue)
            {
                NPathDateTimeValue value = (NPathDateTimeValue)expression;
                EmitDateTimeValue(value);
            }
            if (expression is NPathGuidValue)
            {
                NPathGuidValue value = (NPathGuidValue)expression;
                EmitGuidValue(value);
            }
            if (expression is NPathStringValue)
            {
                NPathStringValue value = (NPathStringValue)expression;
                EmitStringValue(value);
            }
            if (expression is NPathIdentifier)
            {
                NPathIdentifier propertyPath = (NPathIdentifier)expression;
                EmitPropertyPath(propertyPath);
            }
            if (expression is NPathPropertyFilter)
            {
                NPathPropertyFilter propertyFilter = (NPathPropertyFilter)expression;
                EmitPropertyFilter(propertyFilter);
            }
            if (expression is NPathParenthesisGroup)
            {
                NPathParenthesisGroup parenthesisGroup = (NPathParenthesisGroup)expression;
                EmitParenthesisGroup(parenthesisGroup);
            }
            if (expression is NPathMathExpression)
            {
                NPathMathExpression mathExpression = (NPathMathExpression)expression;
                EmitMathExpression(mathExpression);
            }
            if (expression is NPathCompareExpression)
            {
                NPathCompareExpression compareExpression = (NPathCompareExpression)expression;
                EmitCompareExpression(compareExpression);
            }

            if (expression is NPathBooleanExpression)
            {
                NPathBooleanExpression boolExpression = (NPathBooleanExpression)expression;
                EmitBooleanExpression(boolExpression);
            }
            if (expression is NPathInExpression)
            {
                NPathInExpression value = (NPathInExpression)expression;
                EmitIn(value);
            }
            if (expression is NPathSearchFunction)
            {
                NPathSearchFunction value = (NPathSearchFunction)expression;
                EmitSearchFunction(value);
            }
        }
コード例 #3
0
 protected virtual void EmitSearchFunction(NPathSearchFunction searchFunction)
 {
     Write(" {0} ( {1},", searchFunction.FunctionName, searchFunction.PropertyPath);             // do not localize
     EmitStringValue(searchFunction.SearchString);
     Write(")");
 }