Exemplo n.º 1
0
        // Compiles top level expressions
        internal virtual OpcodeBlock Compile(XPathExpr expr)
        {
            Fx.Assert(null != expr, "");

            this.nestingLevel = 1;
            this.pushInitialContext = false;

            XPathExprCompiler exprCompiler = new XPathExprCompiler(this);
            OpcodeBlock mainBlock = exprCompiler.Compile(expr);
            if (this.pushInitialContext)
            {
                OpcodeBlock expandedBlock = new OpcodeBlock();
                expandedBlock.Append(new PushContextNodeOpcode());
                expandedBlock.Append(mainBlock);
                expandedBlock.Append(new PopContextNodes());
                return expandedBlock;
            }
            return mainBlock;
        }
Exemplo n.º 2
0
        // Compiles top level expressions
        internal virtual OpcodeBlock Compile(XPathExpr expr)
        {
            Fx.Assert(null != expr, "");

            this.nestingLevel       = 1;
            this.pushInitialContext = false;

            XPathExprCompiler exprCompiler = new XPathExprCompiler(this);
            OpcodeBlock       mainBlock    = exprCompiler.Compile(expr);

            if (this.pushInitialContext)
            {
                OpcodeBlock expandedBlock = new OpcodeBlock();
                expandedBlock.Append(new PushContextNodeOpcode());
                expandedBlock.Append(mainBlock);
                expandedBlock.Append(new PopContextNodes());
                return(expandedBlock);
            }
            return(mainBlock);
        }
Exemplo n.º 3
0
 OpcodeBlock CompileBlock(XPathExpr expr)
 {
     XPathExprCompiler compiler = new XPathExprCompiler(this);
     return compiler.Compile(expr);
 }
Exemplo n.º 4
0
            OpcodeBlock CompileBlock(XPathExpr expr)
            {
                XPathExprCompiler compiler = new XPathExprCompiler(this);

                return(compiler.Compile(expr));
            }