예제 #1
0
 internal XPathCompiler(QueryCompilerFlags flags)
 {
     this.flags = flags;
     this.pushInitialContext = false;
 }
예제 #2
0
 internal XPathCompiler(FilterOptimizer optimizer, QueryCompilerFlags flags)
 {
     this.optimizer = optimizer;
     this.flags = flags;
     this.pushInitialContext = false;
 }
예제 #3
0
 internal XPathCompiler(QueryCompilerFlags flags)
     : this(new FilterOptimizer(SelectFunctionTree.standard), flags)
 {
 }
 internal static OpcodeBlock CompileForInternalEngine(string xpath, XmlNamespaceManager ns, QueryCompilerFlags flags, out ValueDataType returnType)
 {
     return(CompileForInternalEngine(xpath, ns, flags, defaultFunctionLibs, out returnType));
 }
        internal static OpcodeBlock CompileForInternalEngine(string xpath, XmlNamespaceManager nsManager, QueryCompilerFlags flags, IFunctionLibrary[] functionLibs, out ValueDataType returnType)
        {
            returnType = ValueDataType.None;
            if (xpath.Length == 0)
            {
                OpcodeBlock block = new OpcodeBlock();
                block.Append(new PushBooleanOpcode(true));
                return(block);
            }
            XPathExpr expr = new XPathParser(xpath, nsManager, functionLibs).Parse();

            if (expr == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryCompileException(QueryCompileError.CouldNotParseExpression));
            }
            returnType = expr.ReturnType;
            XPathCompiler compiler = new XPathCompiler(flags);

            return(compiler.Compile(expr));
        }
 internal static OpcodeBlock CompileForInternalEngine(XPathMessageFilter filter, QueryCompilerFlags flags, IFunctionLibrary[] functionLibs, out ValueDataType returnType)
 {
     return(CompileForInternalEngine(filter.XPath.Trim(), filter.namespaces, flags, functionLibs, out returnType));
 }
예제 #7
0
 internal XPathCompiler(QueryCompilerFlags flags)
 {
     this.flags = flags;
     this.pushInitialContext = false;
 }
예제 #8
0
        internal static OpcodeBlock CompileForInternalEngine(string xpath, XmlNamespaceManager nsManager, QueryCompilerFlags flags, IFunctionLibrary[] functionLibs, out ValueDataType returnType)
        {
            OpcodeBlock codeBlock;

            returnType = ValueDataType.None;
            if (0 == xpath.Length)
            {
                // 0 length XPaths always match
                codeBlock = new OpcodeBlock();
                codeBlock.Append(new PushBooleanOpcode(true)); // Always match by pushing true on the eval stack
            }
            else
            {
                // Try to parse the xpath. Bind to default function libraries
                // The parser returns an expression tree
                XPathParser parser    = new XPathParser(xpath, nsManager, functionLibs);
                XPathExpr   parseTree = parser.Parse();

                if (null == parseTree)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryCompileException(QueryCompileError.CouldNotParseExpression));
                }

                returnType = parseTree.ReturnType;

                // Compile the expression tree
                XPathCompiler compiler = new XPathCompiler(flags);

                codeBlock = compiler.Compile(parseTree);
            }

            return(codeBlock);
        }
예제 #9
0
 internal XPathCompiler(QueryCompilerFlags flags)
     : this(new FilterOptimizer(SelectFunctionTree.standard), flags)
 {
 }
예제 #10
0
 internal XPathCompiler(FilterOptimizer optimizer, QueryCompilerFlags flags)
 {
     this.optimizer          = optimizer;
     this.flags              = flags;
     this.pushInitialContext = false;
 }