예제 #1
0
 protected virtual void EmitSearchFunction(NPathSearchFunction searchFunction)
 {
     Write(" {0} ( {1},", searchFunction.FunctionName, searchFunction.PropertyPath); // do not localize
     EmitStringValue(searchFunction.SearchString);
     Write(")");
 }
예제 #2
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;
        }