Inheritance: ContextQuery
Exemple #1
0
        private Query ProcessNode(AstNode root, Flags flags, out Props props)
        {
            if (++parseDepth > MaxParseDepth)
            {
                throw XPathException.Create(Res.Xp_QueryTooComplex);
            }

            Debug.Assert(root != null, "root != null");
            Query result = null;

            props = Props.None;
            switch (root.Type)
            {
            case AstNode.AstType.Axis:
                result = ProcessAxis((Axis)root, flags, out props);
                break;

            case AstNode.AstType.Operator:
                result = ProcessOperator((Operator)root, out props);
                break;

            case AstNode.AstType.Filter:
                result = ProcessFilter((Filter)root, flags, out props);
                break;

            case AstNode.AstType.ConstantOperand:
                result = new OperandQuery(((Operand)root).OperandValue);
                break;

            case AstNode.AstType.Variable:
                result = ProcessVariable((Variable)root);
                break;

            case AstNode.AstType.Function:
                result = ProcessFunction((Function)root, out props);
                break;

            case AstNode.AstType.Group:
                result = new GroupQuery(ProcessNode(((Group)root).GroupNode, Flags.None, out props));
                break;

            case AstNode.AstType.Root:
                result = new AbsoluteQuery();
                break;

            default:
                Debug.Assert(false, "Unknown QueryType encountered!!");
                break;
            }
            --parseDepth;
            return(result);
        }
Exemple #2
0
 private AbsoluteQuery(AbsoluteQuery other) : base(other)
 {
 }